Description

Helpful utilities for dealing with colors.

Methods


<static> getRGB( color ) → {array}

Description

Will get the red green and blue values of any color string.

Parameters
Name Type Description
color string

the color to obtain the red, green and blue values of. Can be in any of these formats: #fff, #ffffff, rgb, rgba

Returns
  • array containing the red, green, and blue values

<static> darkenColor( color, percent ) → {string}

Description

Will get the darken the color by a certain percent

Parameters
Name Type Description
color string

Can be in any of these formats: #fff, #ffffff, rgb, rgba

percent number

percent to darken the color by (0-100)

Returns
  • new color in rgb format

<static> lightenColor( color, percent ) → {string}

Description

Will get the lighten the color by a certain percent

Parameters
Name Type Description
color string

Can be in any of these formats: #fff, #ffffff, rgb, rgba

percent number

percent to lighten the color by (0-100)

Returns
  • new color in rgb format

<static> rgbToAlpha( color, alpha ) → {string}

Description

Converts a color to rgba format string

Parameters
Name Type Description
color string

Can be in any of these formats: #fff, #ffffff, rgb, rgba

alpha number

alpha level for the new color

Returns
  • new color in rgb format