Color API (hyperion.color.*)
Constructors and helpers
| Function |
Return |
Throws |
Description |
hyperion.color.rgba(r, g, b, a) |
RGBA |
No |
Create RGBA color (0-255). |
hyperion.color.rgb(r, g, b) |
RGBA |
No |
Create RGB with full alpha. |
hyperion.color.fromHex(hex) |
RGBA |
No |
Parse hex color (returns white on invalid input). |
hyperion.color.fromName(name) |
RGBA |
No |
Parse color name (returns white on invalid input). |
hyperion.color.lerp(c1, c2, t) |
RGBA |
No |
Interpolate between two colors. |
Color fields and methods
| Method or field |
Return |
Throws |
Description |
color.r, color.g, color.b, color.a |
number |
No |
Components (read/write). |
color:withAlpha(alpha) |
RGBA |
No |
Return copy with new alpha. |
Preset colors
hyperion.color.white, hyperion.color.black, hyperion.color.red, hyperion.color.green,
hyperion.color.blue, hyperion.color.yellow, hyperion.color.cyan,
hyperion.color.magenta, hyperion.color.transparent.