Skip to content
A really simple package that enables you to specify an opacity for your HEX colours.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore first commit Jun 22, 2019
LICENSE Initial commit Jun 22, 2019
index.js first commit Jun 22, 2019
index.test.js first commit Jun 22, 2019
package.json bump version Jun 22, 2019
readme.md Resolve typos in examples Jun 22, 2019
utils.js first commit Jun 22, 2019
utils.test.js first commit Jun 22, 2019
yarn.lock first commit Jun 22, 2019

readme.md

HEX-ALPHA

A really simple package that enables you to specify an opacity for your HEX colours.

HEX + Alpha = RGBA

Installation

npm install hex-alpha
// or
yarn add hex-alpha

Examples

import hexAlpha from "hex-alpha";

hexAlpha("#fa6d01", 0.1);
// returns "rgba(250,109,1, 0.1)"

hexAlpha("#000000", 1);
// returns "rgba(0,0,0,1)"

hexAlpha("#ffffff");
// returns "rgb(255,255,255)"
You can’t perform that action at this time.