Skip to main content

Color

The Color type represents a color in 8-bit RGBA format. They are represented the same way as HTML hex codes - 6 hexadecimal digits prefixed with a # character, the first two digits representing the amount of red, second two digits representing green and third two digits representing blue. If there are 8 digits, then the last two digits represent the alpha channel - how opaque the color is.

#ff0000 // red
#00ff00 // green
#0000ff // blue
#ff8800 // orange
#ff000080 // red, 50% transparent
#f00 // equivalent to #ff0000
#f008 // equivalent to #ff000088

There a certain color constants that can be used in for user interface elements only. See the Colors section in the reference.