Encoded by a six-digit hexadecimal number, preceded by a hash # mark (#RRGGBB) where 00 ≤ RR, GG, BB ≤ ff. The first two digits describe the red, the second two digits describe the green, and the last two digits describe the blue.
Encoded by the command rgb(red, green, blue) where 0 ≤ red, green, blue ≤ 255. The first (decimal) number describes the red, the second number describes the green, and the last number describes the blue.
Encoded by the command hsl(hue, saturation, lightness) where 0 ≤ hue ≤ 360, 0% ≤ saturation ≤ 100%, and 0% ≤ lightness ≤ 100%.
By name. There are nearly 150 named colours.
I use hexadecimal representation and that seems to be the encoding most commonly used. The following charts show the range of colours that can be described. Each chart is for a given red (RR) value, with the green (GG) value increasing downward and the blue (BB) value increasing to the right. For example, the rectangle in the upper left corner of the first chart is black which has the code #000000. Pure blue (#0000ff) is on the upper right corner of the first chart and lime green (#00ff00) is on the lower left corner. Pure red (#ff0000) appears on the upper left corner of the last chart, with white (#ffffff) in the lower right corner.
A number of colours can be referred to by name. Several of the named colours have two recognised names: