Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/is-css-color-hex
Determine if a string is a valid CSS color hex
https://github.com/dustinspecker/is-css-color-hex
Last synced: 2 days ago
JSON representation
Determine if a string is a valid CSS color hex
- Host: GitHub
- URL: https://github.com/dustinspecker/is-css-color-hex
- Owner: dustinspecker
- License: mit
- Created: 2015-08-30T18:32:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T20:11:15.000Z (over 7 years ago)
- Last Synced: 2024-11-01T00:36:06.932Z (7 days ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# is-css-color-hex
[![NPM version](https://badge.fury.io/js/is-css-color-hex.svg)](https://badge.fury.io/js/is-css-color-hex) [![Build Status](https://travis-ci.org/dustinspecker/is-css-color-hex.svg)](https://travis-ci.org/dustinspecker/is-css-color-hex) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/is-css-color-hex.svg)](https://coveralls.io/r/dustinspecker/is-css-color-hex?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/is-css-color-hex/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/is-css-color-hex) [![Dependencies](https://david-dm.org/dustinspecker/is-css-color-hex.svg)](https://david-dm.org/dustinspecker/is-css-color-hex/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/is-css-color-hex/dev-status.svg)](https://david-dm.org/dustinspecker/is-css-color-hex/#info=devDependencies&view=table)
> Determine if a string is a valid CSS color hex
## Install
```
npm install --save is-css-color-hex
```## Usage
### ES2015
```javascript
import isCSSColorHex from 'is-css-color-hex';isCSSColorHex(1);
// => falseisCSSColorHex('0aC');
// => falseisCSSColorHex('0aCf');
// => falseisCSSColorHex('01AbCd');
// => falseisCSSColorHex('01AbCdff');
// => falseisCSSColorHex('#0aC');
// => trueisCSSColorHex('#0aCf');
// => trueisCSSColorHex('#01AbCd');
// => trueisCSSColorHex('#01AbCdfF');
// => true
```### ES5
```javascript
var isCSSColorHex = require('is-css-color-hex');isCSSColorHex(1);
// => falseisCSSColorHex('0aC');
// => falseisCSSColorHex('0aCf');
// => falseisCSSColorHex('01AbCd');
// => falseisCSSColorHex('01AbCdff');
// => falseisCSSColorHex('#0aC');
// => trueisCSSColorHex('#0aCf');
// => trueisCSSColorHex('#01AbCd');
// => trueisCSSColorHex('#01AbCdfF');
// => true
```## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)