Version 0 of Tk color picker a bit modified and explained

Updated 2019-01-04 15:17:45 by aplsimple

Tk color picker

The native Tk color picker (tk_chooseColor) is used in Unix platforms as they have no default color picker, while Windows and Mac OS have.

Probably tk_chooseColor looks like an ugly duckling among its tough 'Big Brothers'. Though, the Windows' color picker is somewhat cumbersome, except for its toning bar which is very good feature. Of course the coolest of all is Mac OS' color picker implementing the color circle.

Nevertheless, I would try and show some remarkable features of tk_chooseColor which are enhanced with my little changes, available here:

http://aplsimple.ucoz.ru/misc/tkcolorpicker.rar

The changes are seen on the screenshot:

Tk color picker a bit modified

... and on the video:

http://aplsimple.ucoz.ru/doc/tkcc_files/tkcolorpicker.mkv

The changes to tk_chooseColor are the following:

1. The resizing of window is locked (supposedly the resizing makes no sense, at least in the current version of tk_chooseColor).

2. The 'Move all' checkbox is added allowing to move all (R, G, B) selectors simultaneously.

3. The 'Tone moves' checkbox is added allowing to implement the toning feature for a current color.

Useful features of tk_chooseColor

Before exploring a usage example of tk_chooseColor, let's consider few features of tk_chooseColor that are not too obvious.

1. In tk_chooseColor you can move (and would find it very convenient) any selector with clicking and dragging the mouse over the color bars. See the example of this on the video.

2. You can input a Tk standard color name in the entry field. This feature is also demonstrated on the video. Here:

http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm

you can see all Tk standard colors sorted by names.

And here:

http://aplsimple.ucoz.ru/doc/tkcc_files/tkcolors-sorted-by-red.txt

http://aplsimple.ucoz.ru/doc/tkcc_files/tkcolors-sorted-by-green.txt

http://aplsimple.ucoz.ru/doc/tkcc_files/tkcolors-sorted-by-blue.txt

you can see all Tk standard colors sorted by Red, Green and Blue values.

These sortings are useful when you need to view some analogous colors that are close to each other by not their names but hues.

3. Using only three 'magic' numbers (0, 128, 255) you can get combination of 27 colors which are nearly all you need - primary, secondary and tertiary ones. All those red, green, blue, cyan, magenta, yellow, olive, purple, teal etc. and their tones.

But what makes tk_chooseColor so remarkable is that you can easily see and access all neighboring colors for the selected one. They are located at both sides of tk_chooseColor's selectors.

For example, in tk_chooseColor you can easily locate the brownish range of colors (terra incognita for some color pickers). At that, it's enough to know that brown contains no blue. See the mentioned video demoing it.

4. The tk_chooseColor is very helpful in the color designing of color schemes, e.g. for your applications or themed editors.

Applying Tk color picker to a color design

Here:

http://aplsimple.ucoz.ru/doc/tkcc.html

you can see in details how to design the color scheme for TKE editor .

Just for the impression of it, the TKE screenshot with developed color theme is presented below:

TKE editor