1.0.0 • Published 3 years ago

@kelv/hexa-to-rgba v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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.