Socket
Socket
Sign inDemoInstall

is-css-color-hex

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-css-color-hex

Determine if a string is a valid CSS color hex


Version published
Maintainers
1
Install size
5.39 kB
Created

Readme

Source

is-css-color-hex

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Determine if a string is a valid CSS color hex

Install

npm install --save is-css-color-hex

Usage

ES2015

import isCSSColorHex from 'is-css-color-hex';

isCSSColorHex(1);
// => false

isCSSColorHex('0aC');
// => false

isCSSColorHex('0aCf');
// => false

isCSSColorHex('01AbCd');
// => false

isCSSColorHex('01AbCdff');
// => false

isCSSColorHex('#0aC');
// => true

isCSSColorHex('#0aCf');
// => true

isCSSColorHex('#01AbCd');
// => true

isCSSColorHex('#01AbCdfF');
// => true

ES5

var isCSSColorHex = require('is-css-color-hex');

isCSSColorHex(1);
// => false

isCSSColorHex('0aC');
// => false

isCSSColorHex('0aCf');
// => false

isCSSColorHex('01AbCd');
// => false

isCSSColorHex('01AbCdff');
// => false

isCSSColorHex('#0aC');
// => true

isCSSColorHex('#0aCf');
// => true

isCSSColorHex('#01AbCd');
// => true

isCSSColorHex('#01AbCdfF');
// => true

LICENSE

MIT © Dustin Specker

Keywords

FAQs

Last updated on 11 Jan 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc