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.
- 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
/black
formatted
pip install ctk-colorpicker-plus
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()
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()
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
- Python 3.8+
- CustomTkinter
- Pillow
Install dependencies:
pip install customtkinter Pillow
This project is released under the MIT License.
Attribution: Based on CTkColorPicker by Akash Bora (Akasacape), originally released under CC0.