optic-color
Colour types and conversions for the Optic engine.
Provides RGBA, RGB, HSV, HSL with conversions between each other,
sRGB/linear gamma transfer, hex parsing, lighten/darken/saturate, and
colour gradients.
Key types
| Type | Description |
|---|---|
RGBA |
Red-green-blue-alpha (0–1 f32) |
RGB |
RGB without alpha |
HSV |
Hue-saturation-value |
HSL |
Hue-saturation-lightness |
Gradient |
Multi-stop colour ramp |
use RGBA;
let red = RGBAnew;
let hex = RGBAfrom_hex_u32;
let lit = red.lighten;