Skip to content

Documentation / @ripl/core / ColorParser

Interface: ColorParser ​

Defined in: packages/core/src/color/types.ts:26

A color parser that can test, parse, and serialize a specific color format.

Properties ​

PropertyTypeDescriptionDefined in
patternRegExpPattern that matches color strings this parser can handle.packages/core/src/color/types.ts:28

Methods ​

parse() ​

parse(value): ColorRGBA

Defined in: packages/core/src/color/types.ts:30

Parses a color string into an RGBA tuple.

Parameters ​

ParameterType
valuestring

Returns ​

ColorRGBA


serialize() ​

serialize(...args): string

Defined in: packages/core/src/color/types.ts:32

Serializes RGBA channel values back into a color string in this parser's format.

Parameters ​

ParameterType
...argsColorRGBA

Returns ​

string