Gathering detailed insights and metrics for the-simplest-color-checker
Gathering detailed insights and metrics for the-simplest-color-checker
Gathering detailed insights and metrics for the-simplest-color-checker
Gathering detailed insights and metrics for the-simplest-color-checker
check if color is light or dark to change the text color for instance
npm install the-simplest-color-checker
Typescript
Module System
Min. Node Version
Node Version
NPM Version
73.2
Supply Chain
97.2
Quality
80.1
Maintenance
100
Vulnerability
100
License
TypeScript (99.12%)
HTML (0.88%)
Total Downloads
1,320
Last Day
1
Last Week
10
Last Month
28
Last Year
587
MIT License
5 Stars
25 Commits
1 Forks
3 Watchers
3 Branches
1 Contributors
Updated on Feb 22, 2025
Minified
Minified + Gzipped
Latest Version
4.1.3
Package Id
the-simplest-color-checker@4.1.3
Unpacked Size
38.71 kB
Size
10.57 kB
File Count
25
NPM Version
9.5.1
Node Version
18.16.1
Published on
Jan 21, 2025
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
150%
10
Compared to previous week
Last Month
-28.2%
28
Compared to previous month
Last Year
538%
587
Compared to previous year
A powerful, dependency-free color manipulation library for JavaScript/TypeScript applications.
1npm install the-simplest-color-checker
Go to https://github.com/amans199/the-simplest-color-checker/blob/master/API.md
1import { isLight, getContrastRatio } from 'the-simplest-color-checker'; 2 3// Check if a color is light or dark 4const color = '#3498db'; 5console.log(isLight(color)); // false 6 7// Calculate contrast ratio 8const ratio = getContrastRatio('#000000', '#ffffff'); 9console.log(ratio); // 21 (maximum contrast)
1isValidHex(color: string): boolean 2isValidRGB(r: number, g: number, b: number): boolean 3isValidHSL(h: number, s: number, l: number): boolean
1hexToRGB(hex: string): { r: number; g: number; b: number } 2rgbToHex(r: number, g: number, b: number): string 3rgbToHSL(r: number, g: number, b: number): { h: number; s: number; l: number }
1getBrightness(color: string): number 2isLight(color: string): boolean
1getContrastRatio(color1: string, color2: string): number
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
8 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
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