expand-hex-code
v1.2.3
Published
Expand hex codes from three to six digits
Downloads
6
Readme
expand-hex-code
Expand hex codes from three to six digits
Installation
With npm
npm install expand-hex-code
With yarn
yarn add expand-hex-code
Usage
In a node project
Import the script to your project
import expandHexCode from "expand-hex-code";
// or
const expandHexCode = require("expand-hex-code");
And execute the script:
const hexCode = expandHexCode("#000"); // #000000
const hexCode = expandHexCode("#cb0"); // #ccbb00
const hexCode = expandHexCode("#ffffff"); // #ffffff
Contributing
Fork the repo and clone locally, then run:
yarn install
This will install the devDependencies
packages and build the dist
folder.
Once you've made your desired changes, make sure to write any new tests for your feature and run the tests:
yarn test
If all tests pass, create a pull request.