Home

Awesome

is-hexcolor npmjs.com The MIT License

Check that given value is valid hex color, using hex-color-regex - the best regex for matching hex color values

code climate standard code style travis build status coverage status dependency status

Install

npm i is-hexcolor --save
npm test

Usage

For more use-cases see the tests

var isHexcolor = require('is-hexcolor')

isHexcolor('#ffffff') //=> true
isHexcolor('#fff') //=> true

isHexcolor('fff') //=> false
isHexcolor('#9gg') //=> false
isHexcolor('#abcZZZ') //=> false
isHexcolor('#3333') //=> false
isHexcolor('#44445555') //=> false
isHexcolor('foo bar') //=> false
isHexcolor('foo #fff bar') //=> false
isHexcolor('foo #f3f3f3 bar') //=> false

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github