https://github.com/tiaanduplessis/colors-regex
Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors
https://github.com/tiaanduplessis/colors-regex
colors-regex hexa hsl hsla-colors regular-expression rgba
Last synced: 2 months ago
JSON representation
Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors
- Host: GitHub
- URL: https://github.com/tiaanduplessis/colors-regex
- Owner: tiaanduplessis
- License: mit
- Created: 2016-12-06T20:41:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-02T21:57:01.000Z (over 6 years ago)
- Last Synced: 2025-07-11T05:39:31.139Z (3 months ago)
- Topics: colors-regex, hexa, hsl, hsla-colors, regular-expression, rgba
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colors-regex
[](https://npmjs.org/package/colors-regex)
[](https://npmjs.org/package/colors-regex)
[](https://github.com/RichardLitt/standard-readme)
[](https://npmjs.org/package/colors-regex)
[](http://makeapullrequest.com)> Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#License)## Install
This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).
```sh
$ npm install colors-regex
$ # OR
$ yarn add colors-regex
```## Usage
```js
const assert = require('assert')
const colorRegex = require('colors-regex')assert(colorRegex.hex.strict.test('#000000')) // Success
assert(colorRegex.hex.strict.test('#2')) // Failure```
## Contribute
1. Fork it and create your feature branch: git checkout -b my-new-feature
2. Commit your changes: git commit -am 'Add some feature'
3. Push to the branch: git push origin my-new-feature
4. Submit a pull request## License
MIT