UI module

hex

procedureextensionexperimentalsince 0.31.0Source

A colour from a 0xRRGGBB number.

Example↗
white := hex(0xFFFFFF);
assert(white.x == 1 && white.y == 1 && white.z == 1);
glass := hex(0x3B82F6, 0.5);
assert(glass.w == 0.5);
hex :: (value: u32, alpha: float = 1) -> Color

A colour from a 0xRRGGBB number.

Parameters

value: u32
the colour as 0xRRGGBB.
alpha: float = 1
alpha, 0 to 1.

Returns

Example↗
white := hex(0xFFFFFF);
assert(white.x == 1 && white.y == 1 && white.z == 1);
glass := hex(0x3B82F6, 0.5);
assert(glass.w == 0.5);

See also