0.3.0 • Published 5 years ago

shorten-hexdcolor v0.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

shorten-hexdcolor

The best package to simplify hexadecimal colors

Looking for the source code of the website? It's in the website branch.

Install

With NPM:

npm install shorten-hexdcolor

Or Yarn:

yarn add shorten-hexdcolor

Usage

Import

import shortenHexdColor from 'shorten-hexdcolor';
// commonjs
// const shortenHexdColor = require('shorten-hexdcolor').default;

Main method

Use the imported method above (called shortenHexdColor)

const myColor1 = "#16597B";
const myColor2 = "A0165D";

const coolColor1 = shortenHexdColor(myColor1);
const coolColor2 = shortenHexdColor(myColor2);

Output

console.log(coolColor1); // 115577
console.log(coolColor2); // 991155

Build

Commands

  • Use dev:build to generate common-js compatibility.
0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago