Skip to content

Function: toRGBA() ​

ts
function toRGBA(value): RGBAColor | null;

Experimental

Convert a CSS color to sRGB 0–1 RGBA floats for the renderer, or null if invalid. Results are cached and frozen, so callers must not mutate them.

Parameters ​

ParameterType
valuestring

Returns ​

RGBAColor | null

Released under the MIT License.