Skip to content

Function: parseColor()

ts
function parseColor(input): RgbColor;

Parses a CSS color string (hex, rgb, rgba) into an RgbColor object.

Parameters

ParameterType
inputstring

Returns

RgbColor

Example

ts
parseColor('#ff6600') // => { r: 255, g: 102, b: 0, a: 1 }

Since

1.0.0

Released under the MIT License.