A modern color picker for customtkinter
Project description
CTkColorPicker
A modern color picker made for customtkinter!
Download
pip install CTkColorPicker
Requirements
How to use?
import customtkinter as ctk
from CTkColorPicker import *
def ask_color():
pick_color = AskColor() # open the color picker
color = pick_color.get() # get the color string
button.configure(fg_color=color)
root = ctk.CTk()
button = ctk.CTkButton(master=root, text="CHOOSE COLOR", text_color="black", command=ask_color)
button.pack(padx=30, pady=20)
root.mainloop()
Options
Arguments | Description |
---|---|
width | set the overall size of the color picker window |
title | change the title of color picker window |
fg_color | change forground color of the color picker frame |
bg_color | change background color of the color picker frame |
button_color | change the color of the button and slider |
button_hover_color | change the hover color of the buttons |
text | change the default text of the 'OK' button |
initial_color | set the default color of color picker (currently in beta stage) |
slider_border | change the border width of slider |
corner_radius | change the corner radius of all the widgets inside color picker |
**other button parameters | pass other button arguments if required |
ColorPickerWidget
This is a new color picker widget that can be placed inside a customtkinter frame.
Usage
from CTkColorPicker import *
import customtkinter
root = customtkinter.CTk()
colorpicker = CTkColorPicker(root, width=500, command=lambda e: print(e))
colorpicker.pack(padx=10, pady=10)
root.mainloop()
Options
Arguments | Description |
---|---|
master | parent widget |
width | set the overall size of the color picker frame |
fg_color | change forground color of the color picker frame |
initial_color | set the default color of color picker (currently in beta stage) |
slider_border | change the border width of slider |
corner_radius | change the corner radius of all the widgets inside color picker |
command | add a command when the color is changed |
orientation | change orientation of slider and label |
**other slider parameters | pass other slider arguments if required |
That's all, hope it will help!
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
CTkColorPicker-0.8.0.tar.gz
(121.6 kB
view details)
Built Distribution
File details
Details for the file CTkColorPicker-0.8.0.tar.gz
.
File metadata
- Download URL: CTkColorPicker-0.8.0.tar.gz
- Upload date:
- Size: 121.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c4605d0a5650433333fb1098513a3203342f905aea21f94170725b0310e3955 |
|
MD5 | e1f7718ae4ea35e7628c9cfa49af9230 |
|
BLAKE2b-256 | 49cc272eb5df14f5160b0eca116d98baf28af134020a1515c024b06645efffe0 |
File details
Details for the file CTkColorPicker-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: CTkColorPicker-0.8.0-py3-none-any.whl
- Upload date:
- Size: 123.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbc13116a8e96c497a93a39a58d4d089a51f4b27faebd4dee5e6ecd309e55be8 |
|
MD5 | 0382881114a0321242263896f24b88a4 |
|
BLAKE2b-256 | ba5e10efe432bd9ca668e572a62479dec1bf820a2777aa939855e3feade8089e |