Gathering detailed insights and metrics for validate.io-color-hexadecimal
Gathering detailed insights and metrics for validate.io-color-hexadecimal
Gathering detailed insights and metrics for validate.io-color-hexadecimal
Gathering detailed insights and metrics for validate.io-color-hexadecimal
Validates if a value is a hexadecimal color.
npm install validate.io-color-hexadecimal
Typescript
Module System
Node Version
NPM Version
64.6
Supply Chain
95.1
Quality
74.8
Maintenance
100
Vulnerability
100
License
JavaScript (64.35%)
Makefile (35.65%)
Total Downloads
6,590
Last Day
1
Last Week
5
Last Month
20
Last Year
277
MIT License
1 Stars
4 Commits
1 Watchers
1 Branches
2 Contributors
Updated on Aug 21, 2015
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
validate.io-color-hexadecimal@1.0.0
Size
2.75 kB
NPM Version
2.8.3
Node Version
0.12.7
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
66.7%
5
Compared to previous week
Last Month
11.1%
20
Compared to previous month
Last Year
-18%
277
Compared to previous year
2
6
Validates if a value is a hexadecimal color.
1$ npm install validate.io-color-hexadecimal
For use in the browser, use browserify.
1var isHexColor = require( 'validate.io-color-hexadecimal' );
Validates if a value is a hexadecimal color.
1var bool = isHexColor( 'ffffff' ); 2// returns true
To validate for shorthand, full, or either shorthand or full hexadecimal colors, set the mode
option.
1var bool; 2 3// Full length colors... 4bool = isHexColor( 'ffffff', 'full' ); 5// returns true 6 7bool = isHexColor( 'fff', 'full' ); 8// returns false 9 10 11// Shorthand colors... 12bool = isHexColor( 'ffffff', 'shorthand' ); 13// returns false 14 15bool = isHexColor( 'fff', 'shorthand' ); 16// returns true 17 18 19// Either shorthand or full length colors... 20bool = isHexColor( 'ffffff', 'either' ); 21// returns true 22 23bool = isHexColor( 'fff', 'either' ); 24// returns true
1var isHexColor = require( 'validate.io-color-hexadecimal' ); 2 3console.log( isHexColor( 'ffffff' ) ); 4// returns true 5 6console.log( isHexColor( '000000' ) ); 7// returns true 8 9console.log( isHexColor( 'e0e0e0' ) ); 10// returns true 11 12console.log( isHexColor( 'E0F44A' ) ); 13// returns true 14 15console.log( isHexColor( 'E0f44B' ) ); 16// returns true 17 18console.log( isHexColor( 'FFF' ) ); 19// returns false 20 21console.log( isHexColor( 'FFFFFF', 'shorthand' ) ); 22// returns false 23 24console.log( isHexColor( 'FFF', 'shorthand' ) ); 25// returns true 26 27console.log( isHexColor( 'FFFFFF', 'either' ) ); 28// returns true 29 30console.log( isHexColor( 'fff', 'either' ) ); 31// returns true 32 33console.log( isHexColor( '#ffffff' ) ); 34// returns false
To run the example code from the top-level application directory,
1$ node ./examples/index.js
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
1$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
1$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
1$ make view-cov
Copyright © 2015. Athan Reines.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More