Color picker dialog for Tkinter
Project description
Color picker dialog for Tkinter.
This module contains a ColorPicker class which implements the color picker and an askcolor function that displays the color picker and returns the chosen color in rgb and html formats.
Requirements
Linux, Windows, Mac
Python 2.7 or 3.x with tkinter + ttk (default for Windows but not for Linux)
Installation
With pip:
$ pip install tkcolorpicker
Documentation
askcolor(color=”red”, parent=None, title=_(“Color Chooser”)):
Display the color picker dialog and return the selected color in rgb and html format. An empty tuple is returned if the color selection is cancelled.
- color: initially selected color, the following formats are supported
RGB (0-255 values)
HTML (6-digits)
tkinter color names (see http://wiki.tcl.tk/37701 for a list)
parent: parent window
title: title of the color picker dialog
Example
import tkinter as tk
import tkinter.ttk as ttk
from tkcolorpicker import askcolor
root = tk.Tk()
style = ttk.Style(root)
style.theme_use('clam')
print(askcolor((255, 255, 0), root))
root.mainloop()
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
Built Distributions
File details
Details for the file tkcolorpicker-1.0.1.tar.gz
.
File metadata
- Download URL: tkcolorpicker-1.0.1.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a97a0d1921155b90e23a2a90c46c1e845dc9537beafb718eaf2d3435ba31801 |
|
MD5 | 253b346747c87d03d612cffb9e055891 |
|
BLAKE2b-256 | 59a8334f60717405b4b6e97aab1970dcb1c0142e956190fc0d5420ca27675777 |
File details
Details for the file tkcolorpicker-1.0.1-py3.6.egg
.
File metadata
- Download URL: tkcolorpicker-1.0.1-py3.6.egg
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0e5b45f04f2e967e4fd2b21a9fc7b32eceebcaab9aca708f850379436d7c5f6 |
|
MD5 | 4656b469bdb02b0e79f2fe3d85422627 |
|
BLAKE2b-256 | d4d753a0950add24a7b9c747185ffb8006ff99ebcc38f2dfd0524eedbc09ee7b |
File details
Details for the file tkcolorpicker-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: tkcolorpicker-1.0.1-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48a6e4155eea21ee9f82c4eef83dc3056ed71cb09a08ea6228c93662710d7ec |
|
MD5 | b80a37a156ad942657481e6fd6259a3a |
|
BLAKE2b-256 | 724708afaeb5e66080bdbc9bfd85cda71f27f8bc2115bca1d10051c453d1de19 |