Skip to main content

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.

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

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctk_colorpicker_plus-0.1.1.tar.gz (127.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctk_colorpicker_plus-0.1.1-py3-none-any.whl (126.5 kB view details)

Uploaded Python 3

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

Hashes for ctk_colorpicker_plus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e515e8dc766576d3d30c0ac08cbe75688993fb2635fa0e7c7908791a17c7b808
MD5 45e7d3ce693cb54b121aadc2eabdbe25
BLAKE2b-256 3b517d4355d61db623ae068d25f7b2a50be2054d30961e6a60459914d8a3dc7c

See more details on using hashes here.

File details

Details for the file ctk_colorpicker_plus-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ctk_colorpicker_plus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0298e5fa6ff7776a9399902c0614b3dd46616fc0901735ed517ce66bdd1d898e
MD5 c5ddb7f75290e4508cbb266a468e68d6
BLAKE2b-256 91a70000c7c56fe5239397bc23a42bc08bba713e88d15a6118f97a6ff2ad4734

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page