applyModifiers

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

This function allows you to apply some modifiers to a color. Supported modifiers are:

  • lightness -100
  • lighten -100
  • darken -100
  • saturation -100
  • saturate -100
  • desaturate -100
  • hue -360
  • spin -360
  • alpha -100

Params

  1. input*-Mixed

    The input color to apply modifiers on

  2. [modifiers]*-TApplyModifiersModifiers

    The modifiers to apply

Return

  1. -TApplyModifiersModifiersResult

    The converted color object

Example

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

Todo

  • testsnormal