Skip to main content

tkcolorpicker2

Latest Release Platform Platform Platform License

Color picker dialog for Tkinter. Forked from original https://github.com/j4321/tkColorPicker but with a locale fix.

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)

  • Pillow

Installation

  • With pip:

    $ pip install tkcolorpicker2

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:

  • 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()

Metadata

Release files for tkColorPicker2 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tkColorPicker2 1.0
File Size Uploaded
tkcolorpicker2-1.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tkColorPicker2 1.0
File Interpreter ABI Platform
tkColorPicker2-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.7 kB

Release files / tkcolorpicker2-1.0.tar.gz

Download URL tkcolorpicker2-1.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6a6465e7a39a3168410186c1b5cd530936ca2d853367b6a3f561a9b6a99d4b9e
BLAKE2b-256 checksum
How to use checksums
0e5bd3812c72b1bf544b17e5c535ac992829457d7d5287265f75702c958d3c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.18

Release files / tkColorPicker2-1.0-py3-none-any.whl

Download URL tkColorPicker2-1.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0799d413a6545e867567f98b8e8f7281d0c822ff06f4aca993a3b1a44d28621e
BLAKE2b-256 checksum
How to use checksums
2ef6c14c2bb66bb03cc444233ccc6629ea262b3c12ecaeacacb500a9d3f849e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.18

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page