manipulation/decompose-color
v0.0.1
0.0.1
8
MIT
PUBLIC
38989
1     DEPENDENCIES
BuildPass

Returns an object with the type and values of a color

Use manipulation/decompose-color in your project
npm i @bit/materialui.colors.manipulation.decompose-color

decomposeColor (color:string) : {type: string, values: Array.<number>}

Returns an object with the type and values of a color.

Note: Does not support rgb % values and color names.

Example

```js
 decomposeColor('rgb(255, 255, 255)') // => { type: 'rgb', values: [ 255, 255, 255 ] }
```

Argument

color: string

CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()

Returns

{type: string, values: Array.<number>}

A MUI color object

Test Summary


decomposeColor converts an rgb color string to an object with `type` and `value` keysPass
decomposeColor converts an rgba color string to an object with `type` and `value` keysPass
decomposeColor converts an hsl color string to an object with `type` and `value` keysPass
decomposeColor converts an hsla color string to an object with `type` and `value` keysPass