Enhanced CustomTkinter color picker widget with bug fixes, hex input, and improved reticle/slider behavior.
Project description
ctk-colorpicker-plus
An extended and modernized color picker for CustomTkinter, featuring both a modal dialog and embeddable widget with a color wheel, brightness slider, and hex entry.
Forked from the original CTkColorPicker by Akash Bora (Akascape) — with bug fixes, enhancements, and new features.
Features
- Two usage modes:
AskColor— modal dialog for picking a colorCTkColorPicker— embeddable widget for your layouts
- Accurate reticle positioning — fixed hue/saturation calculation bug
- Brightness slider — smooth 0–255 range
- Hex entry field — accepts user input, short (
#fff) or full (#ffffff) hex values - Real-time updates — changes propagate immediately to the UI and optional callbacks
- Appearance-mode aware — adapts to light/dark or system themes in CustomTkinter
- Fully type-hinted and
ruff/blackformatted
Installation
From PyPI (once published):
pip install ctk-colorpicker-plus
Until then, install from GitHub:
pip install git+https://github.com/calusasoft/ctk-colorpicker-plus.git
Quick Start
Modal Dialog
import customtkinter
from ctk_colorpicker_plus import AskColor
customtkinter.set_appearance_mode("light")
root = customtkinter.CTk()
def pick_color():
dialog = AskColor(initial_color="#ff0000")
color = dialog.get()
if color:
print(f"Selected: {color}")
btn = customtkinter.CTkButton(root, text="Pick a color", command=pick_color)
btn.pack(pady=20)
root.mainloop()
Embedded Widget
import customtkinter
from ctk_colorpicker_plus import CTkColorPicker
def on_color_change(hex_color: str):
print(f"Color changed: {hex_color}")
root = customtkinter.CTk()
picker = CTkColorPicker(root, command=on_color_change)
picker.pack(padx=20, pady=20)
root.mainloop()
Project Structure
ctk_colorpicker_plus/
__init__.py
ctk_color_picker.py # Modal dialog
ctk_color_picker_widget.py # Embeddable widget
color_utils.py # Shared color math and helpers
color_wheel.png
target.png
examples/
demo.py
Requirements
- Python 3.8+
- CustomTkinter
- Pillow
Install dependencies:
pip install customtkinter Pillow
License
This project is released under the MIT License.
Attribution: Based on CTkColorPicker by Akash Bora (Akasacape), originally released under CC0.
Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ctk_colorpicker_plus-0.1.1.tar.gz.
File metadata
- Download URL: ctk_colorpicker_plus-0.1.1.tar.gz
- Upload date:
- Size: 127.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e515e8dc766576d3d30c0ac08cbe75688993fb2635fa0e7c7908791a17c7b808
|
|
| MD5 |
45e7d3ce693cb54b121aadc2eabdbe25
|
|
| BLAKE2b-256 |
3b517d4355d61db623ae068d25f7b2a50be2054d30961e6a60459914d8a3dc7c
|
File details
Details for the file ctk_colorpicker_plus-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ctk_colorpicker_plus-0.1.1-py3-none-any.whl
- Upload date:
- Size: 126.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0298e5fa6ff7776a9399902c0614b3dd46616fc0901735ed517ce66bdd1d898e
|
|
| MD5 |
c5ddb7f75290e4508cbb266a468e68d6
|
|
| BLAKE2b-256 |
91a70000c7c56fe5239397bc23a42bc08bba713e88d15a6118f97a6ff2ad4734
|