Skip to content

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

License

Notifications You must be signed in to change notification settings

nathsimpson/hex-alpha

Repository files navigation

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("#f00");
// returns "rgb(255,0,0)"

Meetup talk

I gave a talk about making HEX-Alpha at the Sydney Javascript meetup - SydJS. Check it out here.

About

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

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •