Expand hex codes from three to six digits
MIT License
Expand hex codes from three to six digits
npm
npm install expand-hex-code
yarn
yarn add expand-hex-code
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
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.