A list of colours to be allocated to each pen in the colour table is called a lookup table. Lookup tables comprise a series of red, green and blue (RGB) intensities, each normalised to 1.0; they may be stored in NDFs--indeed some are provided with KAPPA--or be coded within applications.
A lookup table may be transferred into the display's colour table. However, the number of pens in the colour table is usually not the same as the number of colours in the lookup table and so a simple substitution is not possible. Therefore, KAPPA squeezes or stretches the lookup table to make it fit in the available number of colour-table pens. Normally, linear interpolation between adjacent lookup-table entries defines the resultant colour, though you can select a nearest-neighbour algorithm. The latter is suited to lookup tables with sharp boundaries between contrasting colours, e.g. a series of coloured blocks, and the former to smoothly varying lookup tables where there are no obvious discontinuities, e.g. spectrum-like.
Let's have a few examples.
% lutheat % lutramps % lutread pastel % lutable li ex sawtooth nn % lutsave pirated
LUTHEAT loads the standard `heat' lookup table into the colour table using linear interpolation, whilst LUTRAMPS loads the standard coloured ramps using the nearest neighbours in the lookup table. LUTREAD reads the lookup table stored in the DATA_ARRAY of the NDF called pastel and maps it on to the colour table via linear interpolation. In the fourth example the lookup table in NDF sawtooth is mapped on to the colour table via a linear nearest-neighbour method. ex tells LUTABLE to read an external file. In the final example LUTSAVE saves the current colour table into a lookup-table NDF called pirated. LUTSAVE is quite useful as you can steal other people's attractive colour tables that they've carelessly left in the display's memory! It does not matter should the display not have a palette, since
ICL> lutsave pirated full
will save the full set of pens (including the first 16) to the NDF.
KAPPA --- Kernel Application Package