UI module

with_alpha

procedureextensionexperimentalsince 0.31.0Source

color with its alpha replaced.

Example↗
solid := rgb(10, 20, 30);
assert(with_alpha(solid, 0.25).w == 0.25);
with_alpha :: (color: Color, alpha: float) -> Color

color with its alpha replaced.

Parameters

color: Color
the colour to start from.
alpha: float
the new alpha, 0 to 1.

Returns

Example↗
solid := rgb(10, 20, 30);
assert(with_alpha(solid, 0.25).w == 0.25);

See also