Skip to main content

Color picker dialog for Tkinter forked from original

Project description

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

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkcolorpicker2-1.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkColorPicker2-1.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file tkcolorpicker2-1.0.tar.gz.

File metadata

  • Download URL: tkcolorpicker2-1.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for tkcolorpicker2-1.0.tar.gz
Algorithm Hash digest
SHA256 6a6465e7a39a3168410186c1b5cd530936ca2d853367b6a3f561a9b6a99d4b9e
MD5 a89b56db611e8578105a2d09510d1661
BLAKE2b-256 0e5bd3812c72b1bf544b17e5c535ac992829457d7d5287265f75702c958d3c39

See more details on using hashes here.

File details

Details for the file tkColorPicker2-1.0-py3-none-any.whl.

File metadata

  • Download URL: tkColorPicker2-1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for tkColorPicker2-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0799d413a6545e867567f98b8e8f7281d0c822ff06f4aca993a3b1a44d28621e
MD5 a878a44244244e4afdc05dfe918d35ed
BLAKE2b-256 2ef6c14c2bb66bb03cc444233ccc6629ea262b3c12ecaeacacb500a9d3f849e1

See more details on using hashes here.

Supported by

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