Skip to content

Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors

License

Notifications You must be signed in to change notification settings

tiaanduplessis/colors-regex

Repository files navigation

colors-regex

package version package downloads standard-readme compliant package license make a pull request

Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors

Table of Contents

Install

This project uses node and npm.

$ npm install colors-regex
$ # OR
$ yarn add colors-regex

Usage

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

About

Regular expressions for rgb, rgba, hex, hexa, hsl & hsla colors

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published