Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
hex-contrast-color
Advanced tools
Javascript utility for getting a contrasting hex color string (#ffffff
or #000000
) based on a supplied hex color string.
The function accepts full 6 character strings and 3 character shorthand strings. Returns null if supplied value is not a correct hex color string.
npm install --save hex-contrast-color
var hexContrastColor = require('hex-contrast-color');
hexContrastColor('#000000')
> '#ffffff'
hexContrastColor('#ffffff')
> '#000000'
hexContrastColor('#f00')
> '#ffffff'
// Returns null if supplied value is not a correct hex color string
hexContrastColor(123);
> null
hexContrastColor(null);
> null
FAQs
Return a contrasting hex text color for a specific hex background color
The npm package hex-contrast-color receives a total of 348 weekly downloads. As such, hex-contrast-color popularity was classified as not popular.
We found that hex-contrast-color 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.