Colour calibration is achieved by the ColourTrans module using a table that maps device colours (physical colours) to standard colours.
When requesting a colour, ColourTrans takes the palette colour and uses a calibration table to convert the device colours to standard colours, giving a transient palette that maps logical colours to standard colours. The closest match to the standard colour is then selected.
A calibration table is used to map device colours to standard colours. Three separate mapping exist for each component of the device space. e.g red, green and blue on a monitor. Each mapping consists of a series of device component/standard colour pairs.
The format of the pairs is &BBGGRRDD
Where
|<^. BBGGRR
|<^. Standard colour (Blue, Green and Red)|
|<^. DD
|<^. Amount of device component|
The calibration table format is as follows:
|<^{width:8em}. Word|<^. Meaning|
|<^. 0|<^. Number of pairs of component 1 (n~1~)|
|<^. 1|<^. Number of pairs of component 2 (n~2~)|
|<^. 2|<^. Number of pairs of component 3 (n~3~)|
|<^. 3|<^. n~1~ words giving pairs for component 1|
|<^. 3 + n~1~|<^. n~2~ words giving pairs for component 2|
|<^. 3 + n~1~ + n~2~ |<^. n~3~ words giving pairs for component 3|
The size of the table is therefore 3 + n~1~ + n~2~ + n~3~ words.
The three separate mappings for each device component must be sorted in ascending order. To fill the device colour space there must be entries for device components of 0 and 255. This results in at least two pairs for each component.
An example of a calibration table is shown below.
Word | Meaning |
---|---|
&00000002 | 2 pairs of red component |
&00000002 | 2 pairs of green component |
&00000002 | 2 pairs of blue component |
&02010300 | Device colour 000000 corresponds to standard colour &020103 |
&0203FDFF | Device colour 0000FF corresponds to standard colour &0203FD |
&02010300 | Device colour 000000 corresponds to standard colour &020103 |
&03FC02FF | Device colour 00FF00 corresponds to standard colour &030FC02 |
&02010300 | Device colour 000000 corresponds to standard colour &020103 |
&FF0302FF | Device colour FF0000 corresponds to standard colour &FF0302 |
The default mapping is for device colours and standard colours to be the same.
ColourTrans converts a device colour to a standard colour by the following process: