1.0.7 • Published 2 years ago

@labstraction/color-utility v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Functions

setAlphaToHex(hexColor, opacity) ⇒

Set the alpha channel of a hex color to a specific value

Kind: global function
Returns: The hex color with the alpha value applied.

ParamDescription
hexColorthe hex color code without the alpha value.
opacityThe opacity of the color.

fromColorNameToHex(colorName) ⇒

Given a color name, return the hex value of that color (Works only on browsers)

Kind: global function
Returns: A string

ParamDescription
colorNameThe name of the color you want to convert to hex.

toRGBAString(rgba) ⇒

Given an array of four numbers, return a string representing the color in RGBA format

Kind: global function
Returns: A string.

ParamDescription
rgbaan array of four numbers, each between 0 and 255, representing the red, green, blue, and alpha values of the color.

fromColorHexToRGBA(colorHex) ⇒

Given a color in hex format, convert it to an array of RGBA values

Kind: global function
Returns: An array of four numbers.

ParamDescription
colorHexthe hexadecimal color code, e.g. #FFF or #FFFFFF

contrastingColor(colorHex) ⇒

Given a color in hex format, return the color that contrasts with it

Kind: global function
Returns: The contrasting color is being returned.

ParamDescription
colorHexthe color in hex format

luma(colorHex) ⇒

Given a color in hex format, return the luma of that color

Kind: global function
Returns: The luma value of the color.

ParamDescription
colorHexthe hexadecimal value of the color you want to analyze.
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago