Skip to main content

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 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
  • parent: parent window

  • title: title of the color picker dialog

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

tkcolorpicker-1.0.1.tar.gz (20.5 kB view hashes)

Uploaded Source

Built Distributions

tkcolorpicker-1.0.1-py3.6.egg (35.3 kB view hashes)

Uploaded Source

tkcolorpicker-1.0.1-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

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