1. Home
  2. GETRGB procedure

GETRGB procedure

Gets the RGB values and names of the initial default graphics colours of the Genstat pens (R.W. Payne).

No options


COLOUR = scalars or variates Colour numbers
RGB = scalars or variates RGB values
NAME = texts Names of nearest colours


Genstat supports a standard set of colours for graphics whose names and corresponding RGB values are defined in the help information for the PEN directive. The 256 Genstat pens take their initial default colours from this set, and Genstat procedures such as AGRAPH use the sequence of initial default colours of pens 1, 2… to define default colours for their graphs.

GETRGB provides a convenient way of accessing this sequence of colours. The COLOUR parameter specifies a scalar or variate containing the pen number(s) whose initial default colours are required. The RGB parameter saves a scalar or variate containing the corresponding colours, expressed as RGB values (see PEN). The NAME parameter saves a text containing the name of the nearest colour.

Options: none.

Parameters: COLOUR, RGB, NAME.


GETRGB uses the RESET option and SAVE parameter of the PEN directive to get the initial default colours.

Action with RESTRICT

Restrictions are ignored.

See also

Directive: PEN.


Commands for: Graphics.


CAPTION 'GETRGB example'; STYLE=meta
VARIATE [VALUES=1...10] ncolour
GETRGB  ncolour; RGB=rgb; NAME=name
PRINT   ncolour,name,rgb; DECIMALS=0
Updated on March 7, 2019

Was this article helpful?