Color picker dialog for Tkinter
Project description
tkcolorpicker
=============
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"), alpha=False):
Display the color picker dialog and return the selected color in
rgb and html format. (None, None) 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
* alpha: alpha channel support (boolean)
Example
-------
.. code:: python
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()
=============
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"), alpha=False):
Display the color picker dialog and return the selected color in
rgb and html format. (None, None) 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
* alpha: alpha channel support (boolean)
Example
-------
.. code:: python
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
tkcolorpicker-2.1.0.tar.gz
(14.9 kB
view details)
Built Distributions
File details
Details for the file tkcolorpicker-2.1.0.tar.gz
.
File metadata
- Download URL: tkcolorpicker-2.1.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48f54a9069a851a5504113e34b74fad80ef6eaf41da14f16d307a3ebec528d82 |
|
MD5 | e01f217e52c95fa2dca391f82717b07b |
|
BLAKE2b-256 | 65ae04b63d0b2db70d4275dd7c75773af8d211f8d7fc715b5ca9ced0c9fddd09 |
File details
Details for the file tkcolorpicker-2.1.0-py3.6.egg
.
File metadata
- Download URL: tkcolorpicker-2.1.0-py3.6.egg
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24a4229d5ae4ff799a45033bd4f2627c3017519f67f2a8360a0d00bf8cf20c8 |
|
MD5 | 16f645080becd18887528cec97c38eea |
|
BLAKE2b-256 | 8cc6d99b433f106f6d38acde51fa1cd0fd3770965345dca0d8b2bc21300650db |
File details
Details for the file tkcolorpicker-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: tkcolorpicker-2.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce1d782fc95e7f4d9ab882e113645eb76d2a7671c91867692e3ff03679ff0cd |
|
MD5 | 6364e3fec68a9f6b28444ddc61c48e26 |
|
BLAKE2b-256 | fd42369bc2ed0f75e4602d2a7ecc0f27e04787fb75404b5df92be51c878a0242 |
File details
Details for the file tkcolorpicker-2.1.0-py2.7.egg
.
File metadata
- Download URL: tkcolorpicker-2.1.0-py2.7.egg
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 265ea54040753d433a2714711daa5830662019e89666d2b4930d12b2b237bb2a |
|
MD5 | cf7481be104832459d1c7e2a4aeed202 |
|
BLAKE2b-256 | 48d5087109fe6410c92023bfd49c6b5e4ff3827dde1fed9f08522b0eb4b7e342 |
File details
Details for the file tkcolorpicker-2.1.0-py2-none-any.whl
.
File metadata
- Download URL: tkcolorpicker-2.1.0-py2-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e508a0ddf14b424209668c4efafdb40ff00aba9d6f7e70d11fa3d87098a55f54 |
|
MD5 | 35d7a46e3065577c71a734425af98149 |
|
BLAKE2b-256 | 1aa771cc19fa3570eb696e7b8f89c7e16d2e6322f76913e9ac5dad949376fe34 |