
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@imsyy/color-utils
Advanced tools
Some common color processing tools, color format conversion, image processing, etc.
npm install @imsyy/color-utils
| Method Name | Parameters | Description |
|---|---|---|
rgbToHsv | (r: number, g: number, b: number) | Converts RGB values to HSV. |
rgbToHex | (r: number, g: number, b: number) | Converts RGB values to HEX format. |
rgbToHev | (r: number, g: number, b: number) | Converts RGB values to HEV format. |
rgbToCmyk | (r: number, g: number, b: number) | Converts RGB values to CMYK format. |
rgbToHwb | (r: number, g: number, b: number) | Converts RGB values to HWB format. |
hexToRgb | (hex: string) | Converts a HEX string to RGB values. |
hsvToRgb | (h: number, s: number, v: number) | Converts HSV values to RGB format. |
hslToRgb | (h: number, s: number, l: number) | Converts HSL values to RGB format. |
cmykToRgb | (c: number, m: number, y: number, k: number) | Converts CMYK values to RGB format. |
hwbToRgb | (h: number, w: string | number, b: string | number) | Converts HWB values to RGB format. |
for example:
// rgbToHsv
import { rgbToHsv } from "color-utils";
rgbToHsv(255, 0, 0); // { "h": 0, "s": 100, "v": 100 }
| Method Name | Parameters | Description |
|---|---|---|
getRandomColor | () | Generates a random color in RGB format. |
adjustBrightness | (r: number, g: number, b: number, factor: number) | Adjusts the brightness of an RGB color. |
getColorDifference | (color1: string, color2: string) | Calculates the difference between two colors. |
getComplementaryColor | (color: string) | Gets the complementary color of the given color. |
for example:
// getColorDifference
import { getColorDifference } from "color-utils";
getColorDifference("#ffffff", "#000000"); // 441.6729559300637
| Method Name | Parameters | Description |
|---|---|---|
getImageColor | (img: string | HTMLImageElement, quality: number = 5) | Extracts the dominant colors from an image. |
getMDColor | (color: string, option: { type: "rgb" }) | Generates a Material Design color scheme based on a given color. |
for example:
// getMDColor
import { getMDColor } from "color-utils";
getMDColor("#123456");
// Generate
{
"light": {
// ...,
},
"dark": {
// ...,
}
}
npm test
FAQs
A library of easy-to-use image tools
We found that @imsyy/color-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.