convertColor

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.color

This function take as input any color format like rgba Object, hsl Object, hsv Object, hex String, rgba String, hsl String or hsv String and convert it into the wanted format like “rgba”, “hsl”, “hsv”, “hex”, “rgbaString”, “hslString” or “hsvString”

Params

  1. input*-Mixed

    The input color to convert

  2. format”rgba”String

    The format wanted

Return

  1. -Mixed

    The converted color

Example

import { convertColor } from '@blackbyte/sugar/color';
convertColor('rgba(10,20,30,100)', 'rgba'); // => { r: 10, g: 20, b: 30, a: 100 }

Todo

  • testsnormal