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: 25 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 (almost 3 years ago)
- Last Synced: 2024-09-30T15:13:12.104Z (about 1 month 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
[![Build Status](https://travis-ci.org/nielse63/expand-hex-code.svg?branch=master)](https://travis-ci.org/nielse63/expand-hex-code)
[![Coverage Status](https://coveralls.io/repos/github/nielse63/expand-hex-code/badge.svg?branch=master)](https://coveralls.io/github/nielse63/expand-hex-code?branch=master)
[![devDependencies Status](https://david-dm.org/nielse63/expand-hex-code/dev-status.svg)](https://david-dm.org/nielse63/expand-hex-code?type=dev)
[![Code Climate](https://codeclimate.com/github/nielse63/expand-hex-code/badges/gpa.svg)](https://codeclimate.com/github/nielse63/expand-hex-code)
[![NPM version](https://badge.fury.io/js/expand-hex-code.svg)](http://badge.fury.io/js/expand-hex-code)
[![npm](https://img.shields.io/npm/dt/expand-hex-code.svg?style=flat-square)](https://www.npmjs.com/package/expand-hex-code) [![Greenkeeper badge](https://badges.greenkeeper.io/nielse63/expand-hex-code.svg)](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).