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 ​
| Property | Type | Description | Defined in |
|---|---|---|---|
pattern | RegExp | Pattern 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 ​
| Parameter | Type |
|---|---|
value | string |
Returns ​
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 ​
| Parameter | Type |
|---|---|
...args | ColorRGBA |
Returns ​
string