js-colorize
v1.1.4
Published
npm package for using hex colors with opacity
Downloads
10
Maintainers
Readme
js-colorize
Helper funtions for color usage in js.
Download
npm install js-colorize
or
yarn add js-colorize
Usage
import { hexWithAlpha } from "js-colorize";
// ...
var convertedColor = hexWithAlpha("#ffffff", 0.3);
// 'rgba(255, 255, 255, 0.3)'
hexWithAlpha
| Usage | Hex | Alpha | Result |
| ------------------------------ | ----------------------------------------------------------------------------- | ----- | ------------------------ |
| hexWithAlpha("#0a192f", 0.3)
| #0a192f | 0.3 | "rgba(10, 47, 25, 0.3)" |
| hexWithAlpha("#fac300", 0.7)
| #fac300 | 0.7 | "rgba(250, 0, 195, 0.7)" |
Author
- Muhammed Deniz.