Documentation / @ripl/core / ColorParser
Interface: ColorParser
Defined in: packages/core/src/color/types.ts:26
A color parser that can test, parse, and serialise 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
serialise()
serialise(...
args):string
Defined in: packages/core/src/color/types.ts:32
Serialises RGBA channel values back into a color string in this parser's format.
Parameters
| Parameter | Type |
|---|---|
...args | ColorRGBA |
Returns
string