Envision's default colormap was chosen to contain a wide range of useful colors, in a pattern that is easy to manipulate computationally, and also preserve the readability of typical X windows. Readability of other windows is an issue when using 8-bit displays, because Envision changes the entire colormap when you select one of its windows.

Let us first define the penultimate colormap. In the penultimate colormap, the most significant two bits represent the blue component, the next three bits represent the red component, and the three least significant three bits represent the green component. So, if k is a colormap cell, then

- green = k mod 8
- red = floor(k/8) mod 8
- blue = floor(k/64)

These values are then multiplied by suitable constants, so that the values for each component span the range from 0 to 1.

- red = red*0.14
- green = green*0.14
- blue = blue*0.33

The penultimate colormap is easy to manipulate mathematically. However, on an 8-bit display, it tends to leave other windows dark and sometimes unreadable. This is because, in a typical X installation, the first colormap entry is black, followed by white, and then by a selection of relatively light colors which make nice window backgrounds.

Therefore, to create the final colormap, we permute the entries using the function shuffle defined by

- shuffle (0) = 0
- shuffle (x) = 256 - x (for x > 0)

This reverses entries in the range [1,255] but leaves zero fixed. Notice that the function shuffle is its own inverse.

Ownership, Maintenance and Disclaimers

Last modified Monday, 22-Sep-1997 22:50:08 PDT