1.0.3 • Published 2 years ago
@matteor1994/color-utility v1.0.3
��## Functions
setOpacity(hexColor, opacity)
Set the opacity of a hex color
Kind: global function
Returns: The hex color with the opacity applied.
Param | Description |
---|---|
hexColor | the hex color code with the # sign. |
opacity | The opacity of the color. |
fromColorStringToRGBA(colorString)
Converts a color string to an rgba string
Kind: global function
Returns: a string that represents the color in the format of rgb(r, g, b, a).
Param | Description |
---|---|
colorString | The color string to convert to an RGBA string. |
getContrastingColor(hexColor)
Given a hex color, return the color that would be visible against the background
Kind: global function
Returns: a hex color code that is either black or white.
Param | Description |
---|---|
hexColor | The hex color code to convert. |