h6. [[ColourTrans]] h6(. » [[ColourTrans Technical Details|Technical Details]] h6((. » Miscellaneous h2(#module_version_check). Module Version Check Any task that intends to use the ColourTrans module should ensure that a suitable version of the module is present on the system. This is achieved by [[*RMEnsure|*RMEnsure]] Command. The following code is an excerpt from a typical Obey file used within an application to check the presence of a specific version of the ColourTrans module. <pre> RMEnsure ColourTrans 1.78 RMLoad System:Modules.Colours RMEnsure ColourTrans 1.78 Error You need ColourTrans 1.78 or later </pre> h2(#setting_a_colour). Setting a Colour ColourTrans provides multiple SWIs that returns a colour based on a desired input colour. The return value can either be the closest match or the most unclose match. In monochrome mode, the ECF patterns are not used to reflect shades of grey. This is in contrast to [[Wimp_SetColour]] that does. h2(#conversion). Conversion ColourTrans provides a facility to convert GCOLs to colour numbers and vice versa. This only has meaning for 256 colour screen modes. There are also SWIs that convert between different colour models such as RGB, CIE, HSV and CMYK. h2(#sprites_and_fonts). Sprites and Fonts The following SWIs are useful when dealing with sprite and fonts. # [[ColourTrans_SelectTable]] sets up a translation table in the buffer # [[ColourTrans_SelectGCOLTable]] sets up a list of GCOLs in the buffer # [[ColourTrans_ReturnFontColours]] finds the best set of logical colours for an anti-aliased colour range # [[ColourTrans_SetFontColours]] find the best set of logical colours for an anti-aliased colour range, _and_ sets the [[FontManager|Font Manager]] plotting colours. A detailed description on pixel translation tables can be found within the [[Sprites]] section. h2(#palette_changes). Palette Changes ColourTrans maintains a cache containing the mapping of colours to the current palette. If a task changes the output palette, then it must inform ColourTrans by calling [[ColourTrans_InvalidateCache]]. This ensures that ColourTrans will update its own internal cache. A task does not need to inform ColourTrans of a change in palette if a change in screen mode has occurred as it automatically updates its own cache. If however, a task changes a palette colour, or switching output to a sprite, then the task should inform ColourTrans. A task that uses the Wimp interface can safely be used as they never modify the palette. h2(#printing). Printing ColourTrans provides functionality to request a RGB colour rather than a logical colour and this makes it ideal for use with printer drivers, where a printer may be able to more accurately represent a colour using RGB. h4. See also * [[ColourTrans_InvalidateCache]] * [[ColourTrans_ReturnFontColours]] * [[ColourTrans_SelectGCOLTable]] * [[ColourTrans_SelectTable]] * [[ColourTrans_SetFontColours]] * [[Sprites]] * [[FontManager]] * [[Wimp_SetColour]]