<Color>

<Color> == <HexColor> || <CoordColor> || <DecimalColor>

<HexColor> == # <Hex><Hex><Hex><Hex><Hex><Hex> ||
# <Hex><Hex><Hex>

<CoordColor> == ( <X>,<Y> )

<DecimalColor> == ( <Integer> , <Integer> , <Integer> )


The input for <Color> should usually appear in the hexadecimal form <HexColor> as colours are usually coded in HTML documents.   The colour code begins with a # sign and contains a series of three single or double character hexadecimal values for each of the red, green and blue colours.

Example: #000000 or #000 is black, #FFFFFF or #FFF is white, #FF0000 or #F00 is red, #008000 dark green, etc. (The #008000 color cannot be expressed in the three digit format, the color #080 equals the very similar, but not identical color #008800.)

One can also refer to the colour of one individual pixel <CoordColor>, in that the position of the pixel is laid out in the form ( <X> , <Y> ) in parentheses, i.e. (6, 10).   As is usual for coordinate values, they begin from the bottom left at (0,0).

The third possibility to determine colour, <DecimalColor>, is by defining the red, green and blue values by using three whole numbers between 0 and 255.   These values are separated by a comma and enclosed in parentheses.   Therefore, (255, 0, 0) is a pure red.   This method is particularly suited for random colour generation.   For example, by using  (0, 128-192, 0)  a randomly selected green value will be generated.

Last edited: 2023-04-23 23:57:04