
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
re-color-contrast
Advanced tools
Calculate color contrast of two colors, by using WCAG standard calculation.
Calculate color contrast of two colors. The result is a number between 1.0 and 21.0, and can be used to determine if contrast fullfills WCAG success criterion for color contrast.
yarn add re-color-contrast
Then add re-color-contrast as a dependency to bsconfig.json:
"bs-dependencies": [
+ "re-color-contrast"
]
open ReColorContrast;
let blue = "#00f";
let green = "#00ff00";
ColorContrast.getContrast(blue, green); // 6.2618 ...
ColorContrast.getRelativeLuminance(blue); // 0.0722
getContrast(string, string) => float - takes in two hex color strings and returns a float in range [1..21]. 1 is no contrast, and 21 is best contrast (colors of opposing side of spectrum). See WCAG for details on calculation.getRelativeLuminance(string) => float - takes in a hex color string and returns a float in range [0..1]. 0 is no luminance and 1 is max. See WCAG for details on calculation.yarn.lock is updated.FAQs
Calculate color contrast of two colors, by using WCAG standard calculation.
The npm package re-color-contrast receives a total of 2 weekly downloads. As such, re-color-contrast popularity was classified as not popular.
We found that re-color-contrast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.