@kelv/hexa-to-rgba
v1.0.0
Published
A simple package, written in Typescript, that allows you to convert hex(a) strings to rgba strings.
Downloads
3
Readme
Hexa-to-rgba
A simple package, written in Typescript, that allows you to convert hex(a) strings to rgba strings.
Installation
Npm
npm i -D hexa-to-rgba
Yarn
yarn add -D hexa-to-rgba
Usage / Examples
import { convertHexToRgba } from 'hexa-to-rgba';
// or
const convertHexToRgba = require('hexa-to-rgba').convertHexToRgba;
const white = convertHexToRgba('#fff');
const pink = convertHexToRgba('FFC0CB');
const halfOpaquePink = convertHexToRgba('#ffc0cb80');
const halfOpaquePink = convertHexToRgba('#ffc0cb', 0.5);
Acknowledgements
Special thanks to Adrien Rault for helping me through this.