Skip to main content

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")):

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
-------

.. 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.0.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distributions

tkcolorpicker-2.0.0-py3.6.egg (35.3 kB view details)

Uploaded Source

tkcolorpicker-2.0.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file tkcolorpicker-2.0.0.tar.gz.

File metadata

File hashes

Hashes for tkcolorpicker-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d789f289fdbac96fba0e7d0685382e7a82f17e4d27768115ba770930aeced1e7
MD5 ed77aa10964b16b1f1681723d01d8889
BLAKE2b-256 3ef861b447abe08fce051ca98437f3d0f2d2ea5e9e7253c89cd5aed52b7f641c

See more details on using hashes here.

File details

Details for the file tkcolorpicker-2.0.0-py3.6.egg.

File metadata

File hashes

Hashes for tkcolorpicker-2.0.0-py3.6.egg
Algorithm Hash digest
SHA256 f1865f03c7563ba2fb19ea5a571be1902855b6737ccfd02c2b343ac86ae0a64e
MD5 c1723149f18d3d09b34784fca1f75836
BLAKE2b-256 9d7ffe0191686cebe3622fc321f8524c2f75f41b067025d3eb25de3950fe90c2

See more details on using hashes here.

File details

Details for the file tkcolorpicker-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tkcolorpicker-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b4599640175cda6b4c81c106e5948adafc33738bf590cbf0e28aae2e2cc1ec4
MD5 134a9d4b79540089fb819601e0e4eca7
BLAKE2b-256 1646c3d8d885c76e80e01ef7eb68aa5613097afdfecbc9311dc0cf853a379099

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page