npm

Need private packages and team management tools?Check out npm Orgs. »

number-to-css-color

0.1.5 • Public • Published

number-to-css-color

es6 js-standard-style CircleCI

Converts a number to a CSS hex color. It even supports the upcoming CSS4 8 digits notation with alpha.

A note about compatibility

The npm package should be used in an ES6 environment. Even though the published code has ES5 syntax it uses some ES6 features, so you have to make sure to use ES5 and ES6 polyfills if you are in an ancient environment.

Install

npm install number-to-css-color

Usage

import convert from 'number-to-css-color'
 
console.log(convert(0xf)) // -> "#00000f"
console.log(convert(0x10c, {alpha: true})) // -> "#0000010c"

Test

npm test

License

MIT

install

npm i number-to-css-color

Downloadsweekly downloads

6

version

0.1.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability