![UK Officials Consider Banning Ransomware Payments from Public Entities](https://cdn.sanity.io/images/cgdhsj6q/production/28603b6d6b7315d3c2892f11733160f28f958adb-1024x1024.webp?w=400&fit=max&auto=format)
Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
color-contrast
Advanced tools
performance-sensitive wcag contrast ratio calculation between two colors
Performance-sensitive WCAG contrast ratio calculation.
Note: This project is in early development, and versioning is a little different. Read this for more details.
There are several projects that give you the contrast ratio, but I was unable to find any that didn't have too many dependencies to be viable for performance-conscious browser use and were also wcag-compliant. This one is both. It's ~5kb gzipped, and supports all color formats supported by css, so no need to run any type of color conversions in or out.
npm install color-contrast
This is a very simple module, it only exposes a single export and can be used as such:
import colorContrast from 'color-contrast'
colorContrast('#fff', '#000') // => 21
colorContrast('#fff', '#eee') // => 1.1602304710270739
WCAG standards dictate that you want >=4.5
as a ratio for AA compliance and >= 7
for AAA compliance. You should aim for the latter if possible.
FAQs
performance-sensitive wcag contrast ratio calculation between two colors
The npm package color-contrast receives a total of 3,602 weekly downloads. As such, color-contrast popularity was classified as popular.
We found that 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.