Skip to content

calusasoft/ctk-colorpicker-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Modal color picker, light and dark


Features

  • Two usage modes:
    • AskColor - modal dialog for picking a color
    • CTkColorPicker - 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

Animated Demo


Installation

pip install ctk-colorpicker-plus

Quick Start

Modal Dialog

Modal color picker dialog, light-themed

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

Embedded color picker widget, dark-themed

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

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

  • Original Author: Akash Bora (Akascape) - GitHub
  • Maintainer: Phil Rice - GitHub
  • Contributors: Victor Vimbert-Guerlais and the open source community

About

An improved modern color picker made for customtkinter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages