Device-Independent Color Indexing

Three of the index names provide a level of device independence in choosing colors: CLR_DEFAULT, CLR_BACKGROUND, and CLR_NEUTRAL. These indexes enable an application to select colors according to their purpose, and thus build device independence into your applications. The purpose of a color does not vary from one device to another, although the actual color used to implement that purpose might. The following table describes these indexes and the purpose of each:

┌────────────────────┬────────────────────────────────────────┐
│Index               │Purpose                                 │
├────────────────────┼────────────────────────────────────────┤
│CLR_BACKGROUND      │The natural background color for the    │
│                    │device. This is the color of the paper  │
│                    │on a printer, and the window background │
│                    │color (white, by default) on a display. │
├────────────────────┼────────────────────────────────────────┤
│CLR_NEUTRAL         │The contrast color to CLR_BACKGROUND.   │
│                    │This is usually black on a printer, and │
│                    │the default window text color (black, by│
│                    │default) on a display.                  │
├────────────────────┼────────────────────────────────────────┤
│CLR_DEFAULT         │Unless redefined, this has the same     │
│                    │effect as CLR_NEUTRAL.                  │
└────────────────────┴────────────────────────────────────────┘

The colors produced by CLR_DEFAULT, CLR_BACKGROUND, and CLR_NEUTRAL in the default logical color table depend on the output device. For example, CLR_NEUTRAL could produce black on a device with a white background or white on a device with a black background.


[Back: Default Logical Color Table]
[Next: Defining a Logical Color Table]