Loading a Default Color Table

Although you can define your own color tables, IDL provides predefined color lookup tables (LUTs). Each color table contained within this routine is specified through an index value, shown in the following table.

Tip: If you are running IDL on a TrueColor display, set DEVICE, DECOMPOSED = 0 before your first color table related routine is used within an IDL session or program.

 

Name

Sample

    Name

Sample

0

Black-White Linear

  41

CB-Accent

1

Blue-White Linear

  42 CB-Dark2

2

Green-Red-Blue-White

  43 CB-Paired

3

Red Temperature

  44 CB-Pastel1

4

Blue-Green-Red-Yellow

  45 CB-Pastel2

5

Standard Gamma-II

  46 CB-Set1

6

Prism

  47 CB-Set2

7

Red-Purple

  48 CB-Set3

8

Green-White Linear

  49 CB-Blues

9

Green-White Exponential

  50 CB-BuGn

10

Green-Pink

  51 CB-BuPu

11

Blue-Red

  52 CB-GnBu

12

16 Level

  53 CB-Greens

13

Rainbow

  54 CB-Greys

14

Steps

  55 CB-Oranges

15

Stern Special

  56 CB-OrRd

16

Haze

  57 CB-PuBu

17

Blue-Pastel-Red

  58 CB-PuBuGn

18

Pastels

  59 CB-PuRd

19

Hue Sat Lightness 1

  60 CB-Purples

20

Hue Sat Lightness 2

  61 CB-RdPu

21

Hue Sat Value 1

  62 CB-Reds

22

Hue Sat Value 2

  63 CB-YIGn

23

Purple-Red + Stripes

  64 CB-YIGnBu

24

Beach

  65 CB-YIOrBr

25

Mac Style

  66 CB-BrBG

26

Eos A

  67 CB-PiYG

27

Eos B

  68 CB-PRGn

28

Hardcandy

  69 CB-PuOr

29

Nature

  70 CB-RdBu

30

Ocean

  71 CB-RdGy

31

Peppermint

  72 CB-RdYiBu

32

Plasma

  73 CB-RdYiGn

33

Blue-Red 2

  74 CB-Spectral

34

Rainbow 2

       

35

Blue Waves

       

36

Volcano

       

37

Waves

       

38

Rainbow 18

       

39

Rainbow + White

       

40

Rainbow + Black

       

You can load a default color table in an iImage display, an Object Graphics Display or a Direct Graphics display as follows:

Note: See Color Table Manipulation for a list of related routines.

Modifying and Converting Color Tables

IDL contains two graphical user interface (GUI) utilities for modifying a color table, XLOADCT and XPALETTE (. The MODIFYCT routine lets you create or modify and store a new color table. See the following topics for examples:

These examples are based on the default RGB (red, green, and blue) color system. IDL also contains routines that allow you to use other color systems including hue, saturation, and value (HSV) and hue, lightness, and saturation (HLS).

HighlightingFeatures with a Color Table

For indexed images, custom color tables can be derived to highlight specific features. Color tables are usually designed to vary within certain ranges to show dramatic changes within an image. Some color tables are designed to highlight features with drastic color change in adjacent ranges (for example setting 0 through 20 to black and setting 21 through 40 to white).

Note: Color tables are associated with indexed images. RGB images already contain their own color information. If you want to derive a color table for an RGB image, you should convert it to an indexed image with the COLOR_QUAN routine. You should also set COLOR_QUAN’s CUBE keyword to 6 to insure the resulting indexed image is an intensity representation of the original RGB image. See COLOR_QUAN for more information.

See the following topics for examples: