Color¶
Global · Color · server and client scripts
Color is an immutable linear RGBA color. Read R, G, B, and A, blend with :Lerp, adjust alpha with :WithAlpha, convert with :ToHSV and :ToHex, or build colors from linear channels, 0..255 RGB, hex strings, or HSV.
Example
new¶
Color.new creates a color from non-negative linear r, g, b channels and an optional a alpha in [0, 1] (defaults to 1).
Example
fromRGB¶
Color.fromRGB creates a color from r, g, b channels scaled by 255 and an optional a alpha in [0, 255] (defaults to 255).
Example
fromHex¶
Color.fromHex parses a 6-digit or 8-digit hexadecimal color string, with or without a leading #.
Example
fromHSV¶
Color.fromHSV creates a color from hue in degrees, saturation s in [0, 1], non-negative value v, and optional alpha a in [0, 1].
Example
White¶
Color.White is opaque white (1, 1, 1, 1).
Default Color.new(1, 1, 1, 1)
Black¶
Color.Black is opaque black (0, 0, 0, 1).
Default Color.new(0, 0, 0, 1)
Transparent¶
Color.Transparent is transparent black (0, 0, 0, 0).
Default Color.new(0, 0, 0, 0)