# RGB()

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
RGB(red, green, blue [, trans])
RGB(shortcut [, trans])

Description:
Generates an RGB true colour value.
'red', 'blue' and 'green' represent the intensity of each colour.
A value of zero represents black and 255 represents full intensity.
'shortcut' allows common colours to be specified by naming them.
The colours that can be named are white, black, blue, green, cyan, red, magenta, yellow, brown and grey or gray (USA spelling).
For example, RGB(red) or RGB(cyan).
There is also one special colour ‘notblack’, For any video mode this is the darkest colour that is not treated as black by various graphics commands.
'trans' is the level of transparency for colour depth 12. It is optional and defaults to 15 if not specified.

Note that the value returned is an integer and, if it is to be saved, the variable should be declared as an integer to retain the accuracy of the number.

MODE 1,16
CLS
BOX 100,100,300,300,5,RGB(GREEN),RGB(RED)
FOR n = 0 TO 255
LINE 105,n+120,395,n+120,1,RGB(n,n,n) ' gradient
NEXT n
DO:LOOP UNTIL INKEY$ <> ""
END

Also see COLOUR

Last edited: 15 December, 2020