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.0.tar.gz (127.4 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.0-py3-none-any.whl (126.4 kB view details)

Uploaded Python 3

File details

Details for the file ctk_colorpicker_plus-0.1.0.tar.gz.

File metadata

  • Download URL: ctk_colorpicker_plus-0.1.0.tar.gz
  • Upload date:
  • Size: 127.4 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.0.tar.gz
Algorithm Hash digest
SHA256 806c09b0df243f584063f6df01a9d4da9b87b28b2c0d811716bdc33d6a58e9f8
MD5 c6295a097e66726bc8b62af773a13d6c
BLAKE2b-256 b2b69d0a131a5a83cfda3cf00487d679c2dc12a8ef70e85367cad7552af252ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ctk_colorpicker_plus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81da177f93027a021abd5cf315c789f1f3e9079f3d117741153adf3570697a46
MD5 4217b850d5ebc62914c9d38fe52e06ad
BLAKE2b-256 0ce6f43d3df6d48cce642e67831b0cd8c636e9e24690bd8c6f088e2c9d1e0225

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