https://github.com/robertjgabriel/valid-hex-color
Check if hex color is valid or not.
https://github.com/robertjgabriel/valid-hex-color
chrome hex javascript nodejs vue
Last synced: 2 months ago
JSON representation
Check if hex color is valid or not.
- Host: GitHub
- URL: https://github.com/robertjgabriel/valid-hex-color
- Owner: RobertJGabriel
- License: other
- Created: 2018-11-15T08:38:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-15T17:46:13.000Z (over 7 years ago)
- Last Synced: 2025-01-13T14:53:05.661Z (over 1 year ago)
- Topics: chrome, hex, javascript, nodejs, vue
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/valid-hex-color
- Size: 58.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# valid-hex-color [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> Check if hex color is in the valid range.
## Installation
```sh
$ npm install --save valid-hex-color
```
## Usage
```js
const validHexColor = require('valid-hex-color');
validHexColor.check('#fff');
// True
validHexColor.check('#ffffff');
// false
validHexColor.check('#9999sj');
// false
```
## License
Apache-2.0 © [Robert James Gabriel](https://www.robertgabriel.ninja)
[npm-image]: https://badge.fury.io/js/valid-hex-color.svg
[npm-url]: https://npmjs.org/package/valid-hex-color
[travis-image]: https://travis-ci.org/RobertJGabriel/valid-hex-color.svg?branch=master
[travis-url]: https://travis-ci.org/RobertJGabriel/valid-hex-color
[daviddm-image]: https://david-dm.org/RobertJGabriel/valid-hex-color.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/RobertJGabriel/valid-hex-color
[coveralls-image]: https://coveralls.io/repos/RobertJGabriel/valid-hex-color/badge.svg
[coveralls-url]: https://coveralls.io/r/RobertJGabriel/valid-hex-color