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
And the python packages:
tkinter (included in the python distribution for Windows)
Installation
Ubuntu: use the PPA ppa:j-4321-i/ppa
$ sudo add-apt-repository ppa:j-4321-i/ppa $ sudo apt-get update $ sudo apt-get install python(3)-tkcolorpicker
Archlinux:
the package is available on AUR
With pip:
$ pip install tkcolorpicker
Documentation
Syntax:
askcolor(color="red", parent=None, title=_("Color Chooser"), alpha=False)
Open a ColorPicker dialog and return the chosen color.
The selected color is returned as a tuple (RGB(A), #RRGGBB(AA)) (None, None) is returned if the color selection is cancelled.
Arguments:
color: initially selected color, supported formats:
RGB(A)
#RRGGBB(AA)
tkinter color name (see http://wiki.tcl.tk/37701 for a list)
parent: parent window
title: dialog title
alpha: alpha channel suppport
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-2.1.3.tar.gz
.
File metadata
- Download URL: tkcolorpicker-2.1.3.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2933f9781ced0a2b4d31f462dfd6883292a2a72c4dcb4f460026455a7644de99 |
|
MD5 | 5b04fe80007b9a2e69bd8b07f2bf532d |
|
BLAKE2b-256 | 1523640324144846f388772833280ed72a53f24b52333f4d6b36c23ff9f21de6 |
File details
Details for the file tkcolorpicker-2.1.3-py3.7.egg
.
File metadata
- Download URL: tkcolorpicker-2.1.3-py3.7.egg
- Upload date:
- Size: 43.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 262b4f19309d3c0e0b2601ebbbc6b0ca25b09c6e21d99b451026bee77a0999d0 |
|
MD5 | 20d1c35f7047c72f6b2fc690b1ccd0b0 |
|
BLAKE2b-256 | 524444e632303b270a7bcb5fef67389512fe0f49b2f0341cecd06334365b5fb8 |
File details
Details for the file tkcolorpicker-2.1.3-py3-none-any.whl
.
File metadata
- Download URL: tkcolorpicker-2.1.3-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c82ce74a4f455d765c89d5669c7c707dfe88ad3c82a9020ca24f7cdfb71a02e7 |
|
MD5 | 8736e4de847a31998a6a48f8619dec12 |
|
BLAKE2b-256 | a735ac98622b49e7e842f7c06e3de65f13f8a3aeeaefb410b4f44b4c093167c9 |
File details
Details for the file tkcolorpicker-2.1.3-py2.7.egg
.
File metadata
- Download URL: tkcolorpicker-2.1.3-py2.7.egg
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf3dafb2461d6fae6a2ffa85f0d4938222cc42334118b2eb6c66817023fd48b |
|
MD5 | ba1b5e6f38382086a0e06a80be0889d4 |
|
BLAKE2b-256 | dfd771abd82a242442a9f7440cfcc70bfcd1a85b86ce827b19b6ea993b911288 |
File details
Details for the file tkcolorpicker-2.1.3-py2-none-any.whl
.
File metadata
- Download URL: tkcolorpicker-2.1.3-py2-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fadce62684940db32bf0a2ec15e3fe9eec2ea0f0821bca63ab6fd125808943 |
|
MD5 | fbf27ceacf7056cf74914a9293f0a9b9 |
|
BLAKE2b-256 | 2755437898c599f77ac7e8c442a2fdbc69a39d4e2ae11a04ab493e3bc1e19383 |