website is under construction
Lumen

Colors

The color module provides a set of color methods and properties for use in your games when drawing to the screen. Lumen comes with a pre-defined color palette for your convenience, but you can also define your own colors.

Creating Colors

You can create a new color by using either the rgb or hex methods.

RGB

The rgb method accepts three parameters: red, green, and blue. Each parameter should be a number between 0 and 255.

color.rgb(255, 0, 0) // Red

You can also pass in a fourth parameter, alpha, to set the transparency of the color. This should also be a value between 0 and 255.

color.rgb(255, 0, 0, 128) // Red with 50% transparency

Hex

The hex method accepts a single parameter: hex. This should be a string containing a hexadecimal color value. It accepts both 3 and 6 character hex values.

color.hex('#FFF') // White
color.hex('#FF0000') // Red

You can also pass in a hex value that contains an alpha channel.

color.hex('#FF000080') // Red with 50% transparency

Built-in Palette

Black
#000000
RGB: 0, 0, 0
color.black
Dark Blue
#1D2B53
RGB: 29, 43, 83
color.darkBlue
Dark Purple
#7E2553
RGB: 126, 37, 83
color.darkPurple
Dark Green
#008751
RGB: 0, 135, 81
color.darkGreen
Brown
#AB5236
RGB: 171, 82, 54
color.brown
Dark Gray
#5F574F
RGB: 95, 87, 79
color.darkGray
Light Gray
#C2C3C7
RGB: 194, 195, 199
color.lightGray
White
#FFFFFF
RGB: 255, 255, 255
color.white
Red
#FF004D
RGB: 255, 0, 77
color.red
Orange
#FFA300
RGB: 255, 163, 0
color.orange
Yellow
#FFEC27
RGB: 255, 236, 39
color.yellow
Green
#00E436
RGB: 0, 228, 54
color.green
Blue
#29ADFF
RGB: 41, 173, 255
color.blue
Lavender
#83769C
RGB: 131, 118, 156
color.lavender
Pink
#FF77A8
RGB: 255, 119, 168
color.pink
Peach
#FFCCAA
RGB: 255, 204, 170
color.peach