colors-regex
Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors
Table of Contents
Install
$ npm install --save colors-regex
$ yarn add colors-regex
Usage
const assert = require('assert')
const colorsRegex = require('colors-regex');
assert(colorRegex.hex.strict.test('#000000'))
assert(colorRegex.hex.strict.test('#2'))
API
The module exports a single object with the different color types as properties. Each color type has a strict & global regex.
const colorRegex = require('./index')
console.log(colorRegex)
Contribute
Contributions are welcome. Please open up an issue or create PR if you would like to help out.
Note: If editing the README, please conform to the standard-readme specification.
License
Created with ♥ by Tiaan. Licensed under the MIT License.