Skip to content

Documentation / @ripl/3d / resolveColorUnitRGB

Function: resolveColorUnitRGB() ​

resolveColorUnitRGB(value, fallback?): ColorUnitRGB

Defined in: 3d/src/core/color.ts:58

Parses a CSS colour straight into unit-range RGB, falling back to fallback when unparseable.

Parameters ​

ParameterTypeDescription
valuestringAny colour string @ripl/core can parse.
fallbackColorUnitRGBThe colour to return when value cannot be parsed.

Returns ​

ColorUnitRGB

The colour as unit-range RGB.