Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nielse63/expand-hex-code
Expand hex codes from three to six digits
https://github.com/nielse63/expand-hex-code
css expand expand-hex-codes hex-color javascript node yarn
Last synced: 22 days ago
JSON representation
Expand hex codes from three to six digits
- Host: GitHub
- URL: https://github.com/nielse63/expand-hex-code
- Owner: nielse63
- License: mit
- Created: 2017-07-08T19:42:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-27T15:35:17.000Z (about 3 years ago)
- Last Synced: 2025-01-01T17:21:18.427Z (about 2 months ago)
- Topics: css, expand, expand-hex-codes, hex-color, javascript, node, yarn
- Language: JavaScript
- Size: 574 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# expand-hex-code
[](https://travis-ci.org/nielse63/expand-hex-code)
[](https://coveralls.io/github/nielse63/expand-hex-code?branch=master)
[](https://david-dm.org/nielse63/expand-hex-code?type=dev)
[](https://codeclimate.com/github/nielse63/expand-hex-code)
[](http://badge.fury.io/js/expand-hex-code)
[](https://www.npmjs.com/package/expand-hex-code) [](https://greenkeeper.io/)Expand hex codes from three to six digits
## Installation
### With `npm`
```sh
npm install expand-hex-code
```### With `yarn`
```sh
yarn add expand-hex-code
```## Usage
### In a node project
Import the script to your project
```js
import expandHexCode from "expand-hex-code";
// or
const expandHexCode = require("expand-hex-code");
```And execute the script:
```js
const hexCode = expandHexCode("#000"); // #000000
const hexCode = expandHexCode("#cb0"); // #ccbb00
const hexCode = expandHexCode("#ffffff"); // #ffffff
```## Contributing
Fork the repo and clone locally, then run:
```sh
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:```sh
yarn test
```If all tests pass, [create a pull request](https://github.com/nielse63/expand-hex-code/pulls).