Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
color-interfaces
Advanced tools
[![MIT License][license-image]][license-url]
> const color = new Color();
> color.rgb.r = 200;
< 200
> color.hsl.toCss()
< "hsl(0, 100%, 39%)"
> color.rgb.toCss()
< "rgb(200, 0, 0)"
> color.hex.toCss()
< "#c80000"
export interface Color {
rgb: RGBInterface;
rgba: RGBAInterface;
hsl: HSLInterface;
hsla: HSLAInterface;
hsv: HSVInterface;
hsva: HSVAInterface;
hex: HexInterface;
hexa: HexAInterface;
alpha: number;
getRed(): number;
setRed(red: number): void;
getGreen(): number;
setGreen(green: number): void;
getBlue(): number;
setBlue(blue: number): void;
getHue(): number;
setHue(hue: number): void;
getSaturation(): number;
setSaturation(saturation: number): void;
getLightness(): number;
setLightness(lightness: number): void;
getSaturationV(): number;
setSaturationV(saturationV: number): void;
getValue(): number;
setValue(value: number): void;
getContrastRatio(color2: Color): number;
getGreyValue(): number;
getLuminance(): number;
invert(): this;
parseCSSColor(input: string): void;
copy: () => Color;
mixWithColor(color: Color, percent: number): Color;
}
export interface RGBInterface {
r: number;
g: number;
b: number;
get: () => RGB;
set: (rgb: RGB) => RGBInterface;
toCss: () => string;
}
export interface RGBAInterface {
r: number;
g: number;
b: number;
a: number;
get: () => RGBA;
set: (rgba: RGBA) => RGBAInterface;
toCss: () => string;
}
export interface HSLInterface {
h: number;
s: number;
l: number;
get: () => HSL;
set: (hsv: HSL) => HSLInterface;
toCss: () => string;
}
export interface HSLAInterface {
h: number;
s: number;
l: number;
a: number;
get: () => HSLA;
set: (hsva: HSLA) => HSLAInterface;
toCss: () => string;
}
export interface HSVInterface {
h: number;
s: number;
v: number;
get: () => HSV;
set: (hsv: HSV) => HSVInterface;
toCss: () => string;
}
export interface HSVAInterface {
h: number;
s: number;
v: number;
a: number;
get: () => HSVA;
set: (hsv: HSVA) => HSVAInterface;
toCss: () => string;
}
export interface HexInterface {
get: () => HEX;
set: (hex: HEX) => HexInterface;
toCss: () => string;
}
export interface HexAInterface {
a: number;
get: () => HEXA;
set: (hexa: HEXA) => HexAInterface;
toCss: () => string;
}
export type RGB = [number, number, number];
export type RGBA = [number, number, number, number];
export type HSL = [number, number, number];
export type HSLA = [number, number, number, number];
export type HSV = [number, number, number];
export type HSVA = [number, number, number, number];
export type HEX = string;
export type HEXA = string;
FAQs
interfaces for color spaces
The npm package color-interfaces receives a total of 68 weekly downloads. As such, color-interfaces popularity was classified as not popular.
We found that color-interfaces 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.