Giter Club home page Giter Club logo

tkinter_utilities's Introduction

tkinter_utilities

tk-color_widget-helper

tkinter-colors

A Python utility to help choose colors and their color_widget blind equivalents for tkinter GUIs. Draws an interactive color_widget table for 760 color_widget names found in X11 rgb.txt that are recognized by tkinter 8.6. Works with Linux, Windows, and MacOS. Usage: Click on a color_widget name to show its hex code and RGB value and display that color_widget as background. Right-click a different color_widget to change the text foreground. Clicking on another color_widget will retain that selected foreground. Click with a key modifier to show the color_widget blind simulation of the selected color_widget: Shift = deuteranopia, Ctrl = protanopia, Alt(Command) = tritanopia, Shift-Ctrl = grayscale; the foreground color_widget will automatically match the simulation type. Simulated color_widget hex codes and RGB values may not correspond to any named color_widget, but the hex string will be recognized by tkinter. Using the Ctrl key (or Command in macOS) while pressing D, P, T, or G will pop-up a non-interactive color_widget table simulated for deuteranopia, protanopia, tritanopia, or grayscale, respectively. Text in the color_widget display and data fields can be cut, copied, pasted, or edited with standard keyboard and click commands. Runs with Python 3.6 and tkinter 8.6 or later. Color table construction based on code from https://stackoverflow.com/questions/4969543/colour-chart-for-tkinter-and-tix

From the green Code button above, download and unzip the ZIP file. From within the resulting tkinter_utilities-main folder, open a Terminal or Command Prompt.

Usage:

From within the program's folder, use one of these Terminal or Command Prompt commands, depending on your system:

        python3 -m tk_color_helper (recommended for all systems)
        py tk_color_helper.py (Windows)
        python3 tk_color_helper.py (Linux, Mac)
        ./tk_color_helper.py (Linux, Mac)

Command line arguments --help and --about are available, e.g.,

$ python3 -m tk_color_helper --help
usage: tk_color_helper.py [-h] [--about]

optional arguments:
  -h, --help      show this help message and exit
  --about         Provide description, version, GNU license

Table at startup: tkinter-colors

Example usage: Click on LightSeaGreen to select a background... select-background

...next, right-click MediumVioletRed to change the foreground... select-foreground

..next, Shift-click on LightSeaGreen. The background and foreground switch to the simulated colors for deuteranopia. Right-clicking on other colors will display those foreground selections with deuteranopia simulation. Shift-click on different colors to change the simulated background. change-simulation

To display non-interactive pop-up windows of the full color table as seen with deuteranopia, protanopia, tritanopia, and grayscale, use the Ctrl key (or Command key on macOS) with any of the following keys: D, P, T, or G. Deuteranopia: deuteranopeia-simulated-colors

Protanopia: protanopeia-simulated-colors

Tritanopia: tritanopia-simulated-colors

Grayscale: grayscale-simulated-colors

tk_mvc_template.py

A template for setting up a tkinter application with an MVC architecture. Plenty of comments are provided to explain what is going on.

tk_widget_table.py

A template for positioning contiguous widgets in a table format where each Label is bound to various functions. This is the approach used in the tk_color_helper program. While buttons can also be used with this approach, be aware that Button() configurations on MacOS are limited in tkinter.

Example: 15 x 10 table of labels. Colors of several labels were changed by mouse clicks. Texts of labels were defined as serial digits during table construction in a for-loop.

widget-table

tkinter_utilities's People

Contributors

csecht avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.