Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@ant-design/fast-color
Advanced tools
Fast Color Class
import { FastColor } from '@ant-design/fast-color';
// input
new FastColor('#666'); // short hex
new FastColor('#66ccff'); // hex
new FastColor('#66ccffaa'); // hex with alpha
new FastColor('rgba(102, 204, 255, .5)'); // old css rgb syntax
new FastColor('rgb(102 204 255 / .5)'); // new css rgb syntax
new FastColor('hsl(270, 60, 40, .5)'); // old css hsl syntax, with or without unit
new FastColor('hsl(270deg 60% 40% / 50%)'); // new css hsl syntax, with or without unit
new FastColor({ r: 102, g: 204, b: 255, a: 0.5 }); // rgb object
new FastColor({ h: 270, s: 0.6, l: 0.4, a: 0.5 }); // hsl object
new FastColor({ h: 270, s: 0.6, v: 0.4, a: 0.5 }); // hsv object
// clone
const color = new FastColor('#66ccff');
const color2 = new FastColor(color); // clone via constructor
const color3 = color2.clone(); // call clone method
// output
color.toHexString(); // #66ccff
color.toRgb(); // Object { r: 102, g: 204, b: 255, a: 1 }
color.toRgbString(); // rgb(102,204,255)
color.toHsl(); // Object { h: 200, s: 0.6, l: 0.7, a: 1 }
color.toHslString(); // hsl(200,60%,70%)
color.toHsv(); // Object { h: 200, s: 0.6, v: 1, a: 1 }
IE / Edge | Firefox | Chrome | Safari | Electron |
---|---|---|---|---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
TODO
@ant-design/fast-color is released under the MIT license.
FAQs
fast and small color class
We found that @ant-design/fast-color demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.