r3cal
r3cal: Resistor Color Code Calculator: Direnç Renk Kodu Hesaplayıcı
English | Türkçe
A modern, multilingual resistor color code calculator for Python. Supports 4, 5, and 6-band resistors, N/A bands, live previews, and an optional bilingual (EN/TR) interface. Works both as a standalone GUI and as an embeddable widget inside your own Tkinter application.
📦 Installation
pip install r3cal
Python 3.11+ is required. Tkinter ships with the standard library on Windows and macOS. On Linux you may need:
sudo apt install python3-tk # Debian / Ubuntu
sudo dnf install python3-tkinter # Fedora
✨ Features
| Feature | Description |
|---|---|
| 4 / 5 / 6-band support | Switch instantly with radio buttons |
| Full color tables | Digit, multiplier, tolerance, tempco — all N/A entries included |
| Tolerances | ±1, 2, 3, 4, 0.5, 0.25, 0.1, 0.05, 5, 10 % and None = ±20 % |
| Temperature coefficient | 100, 50, 25, 15, 10, 5 ppm/°C (N/A shown when applicable) |
| Multilingual UI | English / Türkçe / Bilingual (both at once) |
| Flexible input | Dropdown, color number (1–13), English name, or Turkish name |
| Live preview | Each band shows its real color in a swatch |
| Smart formatting | Auto Ω / kΩ / MΩ / GΩ / mΩ / µΩ |
| Font scaling | Built-in A+ / A− buttons |
| Embeddable | Pass a Tk window or a Frame |
🚀 Quick Start
Standalone
!python -m r3cal
import r3cal, tkinter as tk; r3cal.R3Cal(tk.Tk()); tk.mainloop()
or
import tkinter as tk
import r3cal
r3cal.R3Cal(tk.Tk())
tk.mainloop()
Embedded in your own window
import tkinter as tk
from tkinter import ttk
import r3cal
root = tk.Tk()
root.title("My App")
root.geometry("1000x800")
frame = ttk.Frame(root, padding=6)
frame.pack(fill="both", expand=True)
app = r3cal.R3Cal(frame) # embed inside a Frame
root.mainloop()
Direct class import
from r3cal import R3Cal
import tkinter as tk
R3Cal(tk.Tk())
tk.mainloop()
🎨 Usage
- Choose 4 / 5 / 6 bands at the top.
- Pick a language:
English,Türkçe, orEnglish + Türkçe. - For each band, do any of these:
- Select a color from the dropdown, or
- Type the color number (
1–13) and press Enter, or - Type the English name (
Red), or - Type the Turkish name (
Kırmızı).
- Results update live: resistance, tolerance, min/max, tempco.
- Use A+ / A− at the bottom to scale the interface font.
Color number reference
| # | English | Türkçe | Role |
|---|---|---|---|
| 1 | Black | Siyah | Digit / Multiplier / N/A |
| 2 | Brown | Kahverengi | Digit / Multiplier / Tolerance / Tempco |
| 3 | Red | Kırmızı | Digit / Multiplier / Tolerance / Tempco |
| 4 | Orange | Turuncu | Digit / Multiplier / Tolerance / Tempco |
| 5 | Yellow | Sarı | Digit / Multiplier / Tolerance / Tempco |
| 6 | Green | Yeşil | Digit / Multiplier / Tolerance |
| 7 | Blue | Mavi | Digit / Multiplier / Tolerance / Tempco |
| 8 | Violet | Mor | Digit / Multiplier / Tolerance / Tempco |
| 9 | Grey | Gri | Digit / Multiplier / Tolerance |
| 10 | White | Beyaz | Digit / Multiplier / N/A |
| 11 | Gold | Altın | Multiplier (×0.1) / Tolerance (±5 %) |
| 12 | Silver | Gümüş | Multiplier (×0.01) / Tolerance (±10 %) |
| 13 | None | Yok | Tolerance (±20 %) |
📚 API Reference
class r3cal.R3Cal(container)
Creates the calculator widget. container can be either:
- a
tkinter.Tk/tkinter.Toplevel→ standalone window, - a
tkinter.ttk.Frame→ embedded widget.
The instance exposes:
| Attribute | Type | Description |
|---|---|---|
scale |
float |
Current font scale (0.7–2.5). Set programmatically before _apply_geometry(). |
lang |
tk.StringVar |
Current language ("en", "tr", "both"). |
band_count |
tk.IntVar |
Current band count (4, 5, 6). |
Color tables (module-level)
from r3cal import DIGIT, MULTIPLIER, TOLERANCE, TEMPCO, COLORS
| Name | Meaning |
|---|---|
DIGIT |
{color: 0..9} |
MULTIPLIER |
{color: multiplier} (Gold=0.1, Silver=0.01) |
TOLERANCE |
{color: percent or None} |
TEMPCO |
{color: ppm/°C or None} |
COLORS |
{key: {"en":…, "tr":…, "preview":…}} |
Helper functions
from r3cal import parse_color, fmt_resistance
parse_color("3") # → "Red"
parse_color("Kırmızı") # → "Red"
parse_color("1 - Black") # → "Black"
fmt_resistance(2200) # → "2.2 kΩ"
🧪 Examples
220 Ω, 4-band (Red-Red-Brown-Gold)
| Band | Color |
|---|---|
| 1 | Red |
| 2 | Red |
| 3 | Brown |
| 4 | Gold |
Result: 220 Ω ±5 %, Min 209 Ω, Max 231 Ω.
220 Ω, 6-band with N/A tempco
| Band | Color |
|---|---|
| 1–3 | Red-Red-Black |
| Multiplier | Black |
| Tolerance | Gold |
| Tempco | Green |
Result: 220 Ω ±5 %, Tempco N/A.
N/A tolerance
Any 4-band resistor with tolerance set to Black or White shows
Tolerance = N/A and Minimum / Maximum = N/A.
🖼️ Screenshot
┌─────────────────────────────────────────────────────────────┐
│ Language / Dil: [ English + Türkçe ▾ ] Bands: ●4 ●5 ●6 │
├─────────────────────────────────────────────────────────────┤
│ Bands / Bantlar │
│ Band/Bant 1 (Digit/Rakam): [3 - Red (Kırmızı) ▾] │
│ Band/Bant 2 (Digit/Rakam): [3 - Red (Kırmızı) ▾] │
│ Band/Bant 3 (Multiplier/Çarpan): [2 - Brown (Kahv.) ▾] │
│ Band/Bant 4 (Tolerance/Tolerans): [11 - Gold (Altın) ▾] │
├─────────────────────────────────────────────────────────────┤
│ Results / Sonuçlar │
│ Resistance / Direnç: 220 Ω │
│ Tolerance / Tolerans: ±5 % │
│ Minimum: 209 Ω │
│ Maximum / Maksimum: 231 Ω │
│ Temperature Coefficient / …: - │
└─────────────────────────────────────────────────────────────┘
🛠️ Development
git clone https://github.com/WhiteSymmetry/r3cal.git
cd r3cal
pip install -e .
python -m r3cal
📄 License
AGPL-3.0 License — see LICENSE.
🙏 Acknowledgements
Color tables follow the IEC 60062 standard and standard resistor datasheets. Built with Tkinter only — no third-party runtime dependencies.
Türkçe
English | Türkçe
Python için çok dilli, modern bir direnç renk kodu hesaplayıcısı. 4, 5 ve 6 bantlı dirençleri destekler; N/A bantlar, canlı renk önizlemeleri ve isteğe bağlı iki dilli (EN/TR) arayüz sunar. Hem bağımsız bir GUI olarak hem de kendi Tkinter uygulamanıza gömülebilir bir bileşen olarak çalışır.
📦 Kurulum
pip install r3cal
Python 3.11+ gereklidir. Tkinter, Windows ve macOS'ta standart kütüphaneyle birlikte gelir. Linux'ta ayrıca kurmanız gerekebilir:
sudo apt install python3-tk # Debian / Ubuntu
sudo dnf install python3-tkinter # Fedora
✨ Özellikler
| Özellik | Açıklama |
|---|---|
| 4 / 5 / 6 bant desteği | Radyo düğmeleriyle anında geçiş |
| Tam renk tabloları | Rakam, çarpan, tolerans, sıcaklık katsayısı — tüm N/A değerleri dâhil |
| Toleranslar | ±1, 2, 3, 4, 0.5, 0.25, 0.1, 0.05, 5, 10 % ve Yok = ±20 % |
| Sıcaklık katsayısı | 100, 50, 25, 15, 10, 5 ppm/°C (gerektiğinde N/A gösterilir) |
| Çok dilli arayüz | English / Türkçe / İki Dilli (aynı anda) |
| Esnek giriş | Açılır menü, renk numarası (1–13), İngilizce ad, Türkçe ad |
| Canlı önizleme | Her bant gerçek rengini bir kutuda gösterir |
| Akıllı format | Otomatik Ω / kΩ / MΩ / GΩ / mΩ / µΩ |
| Font ölçekleme | Yerleşik A+ / A− butonları |
| Gömülebilir | Tk penceresi veya Frame kabul eder |
🚀 Hızlı Başlangıç
Bağımsız çalıştırma
python -m r3cal
veya
import tkinter as tk
import r3cal
r3cal.R3Cal(tk.Tk())
tk.mainloop()
Kendi pencerenize gömme
import tkinter as tk
from tkinter import ttk
import r3cal
root = tk.Tk()
root.title("Uygulamam")
root.geometry("1000x800")
frame = ttk.Frame(root, padding=6)
frame.pack(fill="both", expand=True)
app = r3cal.R3Cal(frame) # bir Frame içine göm
root.mainloop()
Sınıfı doğrudan içe aktarma
from r3cal import R3Cal
import tkinter as tk
R3Cal(tk.Tk())
tk.mainloop()
🎨 Kullanım
- Üstten 4 / 5 / 6 bant seçin.
- Bir dil seçin:
English,TürkçeveyaEnglish + Türkçe. - Her bant için şunlardan herhangi birini yapın:
- Açılır menüden bir renk seçin, veya
- Renk numarasını (
1–13) yazıp Enter'a basın, veya - İngilizce adı yazın (
Red), veya - Türkçe adı yazın (
Kırmızı).
- Sonuçlar anında güncellenir: direnç, tolerans, min/maks, tempco.
- Alttaki A+ / A− butonlarıyla arayüz yazı boyutunu ölçekleyin.
Renk numarası referansı
| # | English | Türkçe | Rol |
|---|---|---|---|
| 1 | Black | Siyah | Rakam / Çarpan / N/A |
| 2 | Brown | Kahverengi | Rakam / Çarpan / Tolerans / Tempco |
| 3 | Red | Kırmızı | Rakam / Çarpan / Tolerans / Tempco |
| 4 | Orange | Turuncu | Rakam / Çarpan / Tolerans / Tempco |
| 5 | Yellow | Sarı | Rakam / Çarpan / Tolerans / Tempco |
| 6 | Green | Yeşil | Rakam / Çarpan / Tolerans |
| 7 | Blue | Mavi | Rakam / Çarpan / Tolerans / Tempco |
| 8 | Violet | Mor | Rakam / Çarpan / Tolerans / Tempco |
| 9 | Grey | Gri | Rakam / Çarpan / Tolerans |
| 10 | White | Beyaz | Rakam / Çarpan / N/A |
| 11 | Gold | Altın | Çarpan (×0.1) / Tolerans (±5 %) |
| 12 | Silver | Gümüş | Çarpan (×0.01) / Tolerans (±10 %) |
| 13 | None | Yok | Tolerans (±20 %) |
📚 API Referansı
class r3cal.R3Cal(container)
Hesaplayıcı bileşenini oluşturur. container şunlardan biri olabilir:
- bir
tkinter.Tk/tkinter.Toplevel→ bağımsız pencere, - bir
tkinter.ttk.Frame→ gömülü bileşen.
Örnek üzerinden erişilebilen öznitelikler:
| Öznitelik | Tür | Açıklama |
|---|---|---|
scale |
float |
Geçerli font ölçeği (0.7–2.5). _apply_geometry()'den önce programatik olarak ayarlanabilir. |
lang |
tk.StringVar |
Geçerli dil ("en", "tr", "both"). |
band_count |
tk.IntVar |
Geçerli bant sayısı (4, 5, 6). |
Renk tabloları (modül düzeyinde)
from r3cal import DIGIT, MULTIPLIER, TOLERANCE, TEMPCO, COLORS
| İsim | Anlam |
|---|---|
DIGIT |
{renk: 0..9} |
MULTIPLIER |
{renk: çarpan} (Altın=0.1, Gümüş=0.01) |
TOLERANCE |
{renk: yüzde veya None} |
TEMPCO |
{renk: ppm/°C veya None} |
COLORS |
{anahtar: {"en":…, "tr":…, "preview":…}} |
Yardımcı fonksiyonlar
from r3cal import parse_color, fmt_resistance
parse_color("3") # → "Red"
parse_color("Kırmızı") # → "Red"
parse_color("1 - Black") # → "Black"
fmt_resistance(2200) # → "2.2 kΩ"
🧪 Örnekler
220 Ω, 4 bant (Kırmızı-Kırmızı-Kahverengi-Altın)
| Bant | Renk |
|---|---|
| 1 | Kırmızı |
| 2 | Kırmızı |
| 3 | Kahverengi |
| 4 | Altın |
Sonuç: 220 Ω ±5 %, Min 209 Ω, Maks 231 Ω.
220 Ω, 6 bant — N/A tempco'lu
| Bant | Renk |
|---|---|
| 1–3 | Kırmızı-Kırmızı-Siyah |
| Çarpan | Siyah |
| Tolerans | Altın |
| Tempco | Yeşil |
Sonuç: 220 Ω ±5 %, Tempco N/A.
N/A tolerans
Toleransı Siyah veya Beyaz olan herhangi bir 4 bantlı direnç
Tolerans = N/A ve Minimum / Maksimum = N/A gösterir.
🖼️ Ekran Görüntüsü
┌─────────────────────────────────────────────────────────────┐
│ Language / Dil: [ English + Türkçe ▾ ] Bands: ●4 ●5 ●6 │
├─────────────────────────────────────────────────────────────┤
│ Bands / Bantlar │
│ Band/Bant 1 (Digit/Rakam): [3 - Red (Kırmızı) ▾] │
│ Band/Bant 2 (Digit/Rakam): [3 - Red (Kırmızı) ▾] │
│ Band/Bant 3 (Multiplier/Çarpan): [2 - Brown (Kahv.) ▾] │
│ Band/Bant 4 (Tolerance/Tolerans): [11 - Gold (Altın) ▾] │
├─────────────────────────────────────────────────────────────┤
│ Results / Sonuçlar │
│ Resistance / Direnç: 220 Ω │
│ Tolerance / Tolerans: ±5 % │
│ Minimum: 209 Ω │
│ Maximum / Maksimum: 231 Ω │
│ Temperature Coefficient / …: - │
└─────────────────────────────────────────────────────────────┘
🛠️ Geliştirme
git clone https://github.com/<kullanıcı>/r3cal.git
cd r3cal
pip install -e .
python -m r3cal
📄 Lisans
AGPL-3.0 Lisansı — ayrıntılar için LICENSE.
🙏 Teşekkür
Renk tabloları IEC 60062 standardını ve standart direnç veri sayfalarını takip eder. Yalnızca Tkinter ile inşa edilmiştir — üçüncü taraf çalışma zamanı bağımlılığı yoktur.
---
## Notlar
- **`python -m r3cal`** komutunun çalışması için `r3cal/__main__.py` dosyası gerekir:
```python
# r3cal/__main__.py
import tkinter as tk
from .r3cal import R3Cal
R3Cal(tk.Tk())
tk.mainloop()
Metadata
Release files for r3cal 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| r3cal-0.1.2.tar.gz | 29.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| r3cal-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.2 kB
Release files / r3cal-0.1.2.tar.gz
| Download URL | r3cal-0.1.2.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18385cd6181c9329b6f4f9fb649e9dc8c83478496bc41c2c60396a9c5aff3dc5
|
|
BLAKE2b-256 checksum How to use checksums |
114a5c7fd6d62c5565decfbdbf91de7793f9c3f7c423ff3c35ae1dffdfef9f6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / r3cal-0.1.2-py3-none-any.whl
| Download URL | r3cal-0.1.2-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19ce734dc7680b35f09b04ce3e45bf8321145276dd336ddf66d9eda1bff34a00
|
|
BLAKE2b-256 checksum How to use checksums |
5029921109da21f5a6e5305cbfd55cc9b05b10f6e47c95a08e9df0c1cc405b36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log