1.0.3 • Published 2 years ago

@matteor1994/color-utility v1.0.3

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

��## Functions

setOpacity(hexColor, opacity)

Set the opacity of a hex color

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

ParamDescription
hexColorthe hex color code with the # sign.
opacityThe 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).

ParamDescription
colorStringThe 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.

ParamDescription
hexColorThe hex color code to convert.