Chapter 21

TK Graphics II

I wish we all communicated with one another with India ink and watercolor brushes; takes a while to get the knack, but from then on everything’s simple. It also encourages people to stuff more meaning into fewer words!

—Don Arnstine


The RGB color cube
Figure 1.
A color wheel
Figure 2.
Shades of grey
Figure 3.
A color fountain
Figure 4.
Shooting pool
Figure 5.
Right-triangle nomenclature
Figure 6.

Example Programs

There are several example programs for chapter 21:  download chapter21.zip.

  1. hls2rgb.py
  2. colormap.py
  3. tkpool.py
  4. colorfountain.py
  5. ccube.py
  6. fountain.py
  7. tkwheel.py


For an excellent short refresher course in trigonometry, visit http://aleph0.clarku.edu/~djoyce/java/trig/.

Find out why radians are useful in trigonometric functions.  Start at the same page.

Modify tkpool.py so that xdelta is always 2.0 pixels rather than the ydelta.

For more nformation on Pong and its history, start by visiting http://www.pong-story.com/intro.htm; an intriguing bit of history can be found here:  http://www.irational.org/APD/cyber/pong_fas.htm.

The best place on the web to start learning about color, and the most accurate by far, is Charles Poynton’s Color Technology page, at http://www.poynton.com/Poynton-color.html.

Valid HTML 4.01 Transitional