1.0.3 • Published 4 years ago

@nicologiuggiola/color-utilities v1.0.3

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

��## Functions <dl> <dt><a href="#setOpacity">setOpacity(hexColor, opacity)</a> </dt> <dd><ul> <li>Set the opacity of a hex color</li> </ul> </dd> <dt><a href="#fromColorStringToRGB">fromColorStringToRGB(hexColor)</a> </dt> <dd><p>Convert a hex color string to an rgba string</p> </dd> <dt><a href="#getContrastingColor">getContrastingColor(stringColor)</a> </dt> <dd><p>Given a string color, return the color that would be displayed if the background were that color</p> </dd> </dl> <a name="setOpacity"></a> ## 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 color you want to change opacity for. | | opacity | The opacity of the color. This is a value between 0 and 1. | <a name="fromColorStringToRGB"></a> ## fromColorStringToRGB(hexColor) Convert a hex color string to an rgba string Kind: global function Returns: a string that represents the color in rgba format. | Param | Description | | --- | --- | | hexColor | The hexadecimal color string. | <a name="getContrastingColor"></a> ## getContrastingColor(stringColor) Given a string color, return the color that would be displayed if the background were that color Kind: global function Returns*: a string of either black or white. | Param | Description | | --- | --- | | stringColor | The color to be converted to a contrasting color. |

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago