Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
color-invert
Advanced tools
yarn add color-invert
import { invert } from 'color-invert';
// or import invert from 'color-invert/lib/invert';
invert('#ff0000'); // #00ffff, works without # too
// available methods
// fade(hex: string, opacity: number = 0.4): string
fade('#ff0000'); // 'rgba(255, 0, 0, 0.4)'
fade('#ff0000', 0.75); // 'rgba(255, 0, 0, 0.75)'
// hexToComponents(hex: string): string[]
hexToComponents('#ff0000'); // ['ff', '00', '00']
// hexToRgb(hex: string, asStr = false): { r: number, g: number, b: number } | string
hexToRgb('#ff0000'); // { r: 255, g: 0, b: 0 }
hexToRgb('#ff0000', true); // 'rgb(255, 0, 0)'
// intToHex(int: number): string
intToHex(255); // 'ff'
// invert(hex: string, asObj = false): string | { r: number, g: number, b: number }
invert('#ff0000'); // #00ffff
invert('ff0000'); // #00ffff
invert('#ff0000', true); // { r: 0, g: 255, b: 255 }
// rgbToHex(r: number, g: number, b: number): string
rgbToHex(255, 0, 0); // '#ff0000'
FAQs
A tool to invert colors in JavaScript.
We found that color-invert 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.