Colour()

Define a new graphics colour based on one of several models

COLOUR:RGB() r=Real g=Real b=Real Create new colour using RGB model
COLOUR:HLS() h=Real l=Real s=Real Create new colour using HLS model
COLOUR:NAMED() name=String Access a named palette colour

example:

	# Draw lines in colours
	# created from two different models
	>> Draw/line 0.0 0.0 1.0 1.0 colour:rgb(0.5, 0.6, 0.7)
	>> Draw/line 0.0 0.0 1.0 1.0 colour:named("SteelBlue")

Note: The number of simultaneous colours available depends on the display hardware.

Colour:Rgb()

Define a new colour index value given a set of RGB (Red, Green, Blue) values. The values of R, G and B are real numbers in the range 0.0-1.0.

Parameters:

r (Real)

Colour intensity value for red

g (Real)

Colour intensity value for green

b (Real)

Colour intensity value for blue

RESULT = (Colour)

Returns a colour index value which may be used instead of the fixed colours (eg $RED, $GREEN) anywhere a colour parameter is required in the Open GENIE graphics system. The index is only valid in the current Open GENIE session.

Colour:Hls()

Define a new colour index value given a set of HLS (Hue, Light, Saturation) values.

Parameters:

h (Real)

H is an angle in degrees with Blue=0.0 (or 360.0), Red=120.0, Green=240.0

l (Real)

L ranges from 0.0 (black) to 1.0 (white)

s (Real)

S ranges from 0.0 (gray) to 1.0 (pure colour)

RESULT = (Colour)

Returns a colour index value which may be used instead of the fixed colours (eg $RED, $GREEN) anywhere a colour parameter is required in the Open GENIE graphics system. The index is only valid in the current Open GENIE session.

Colour:Named()

Look up and instantiate a colour table instance of the named colour

Parameters:

Name (String)

Looks up the named colour on the display colour palette. This may change depending on the windowing system and graphics hardware so care should be taken or code using this may become device dependent.

RESULT = (Colour)

Returns a colour index value which may be used instead of the fixed colours (eg $RED, $GREEN) anywhere a colour parameter is required in the Open GENIE graphics system. The index is only valid in the current Open GENIE session.