Skip to main content

3.3) Colours


IDL uses colour tables with 256 colours and the default colour table is grey-scale, starting at black and changing through to white:


Each colour in the table is referred to by it's index (0 to 255). This is why in the previous example we set the background colour to 255 for white and the plotting colour to 0 for black.

IDL contains a wide range of different colour tables which you can use, or you can even create your own. To get a list of the built-in colour tables, type "xloadct" at the IDL command line.

xloadct

This will display a graphical interface which allows you to browse the colour table and select the one that you want to use. The number to the left of the colour table name can be used to load a color table non-interactively, using the "loadct" command. For example, try loading the "rainbow + white" colour table (number 39) by typing in the following command:

loadct, 39

This is the most commonly used colour table in IDL as it gives you a nice selection of colours ranging from black through purples, blues, greens, yellows and on to red and also set the last colour in the table to white (255).