@labstraction/color-utility v1.0.7
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.
Param | Description |
---|---|
hexColor | the hex color code without the alpha value. |
opacity | The 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
Param | Description |
---|---|
colorName | The 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.
Param | Description |
---|---|
rgba | an 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.
Param | Description |
---|---|
colorHex | the 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.
Param | Description |
---|---|
colorHex | the 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.
Param | Description |
---|---|
colorHex | the hexadecimal value of the color you want to analyze. |