Interfaces
XYZ
interface XYZ { x: number; y: number; z: number; }
LAB
interface LAB { l: number; a: number; b: number; }
RGB
interface RGB { r: number; g: number; b: number; }
HSL
interface HSL { h: number; s: number; l: number; }
Functions
rgbToHex
export declare function rgbToHex(r: number, g: number, b: number): string;
hslToHex
export declare function hslToHex(h: number, s: number, l: number): string;
hslToRGB
export declare function hslToRGB(h: number, s: number, l: number): RGB;
rgbToHSL
export declare function rgbToHSL(r: number, g: number, b: number): HSL;
hexToRGB
export declare function hexToRGB(hex: string): RGB;
hexToInt
/** * @description converts a sliced hex into it's integer equivalent * ex: (000000,1), would take the 1st to digits 00 as hex and convert to int which * is also 0 * but (FFFFFF,1) would give you FF /=> 255 */ export declare function hexToInt(hex: string, index: number): number;
hexToHSL
export declare function hexToHSL(hex: string): HSL;
parseToHex
/** * @description parse a given string of value hex / rgb / hsl format * into it's normalized hex variant */ export declare function parseToHex(colorstring: string): string;
rgbToXYZ
/** * Convert a (0-255) Web RGB to XYZ standards * @param r 0-255 * @param g 0-255 * @param b 0-255 * @returns */ export declare function rgbToXYZ(r: number, g: number, b: number): XYZ;
xyzToLAB
export declare function xyzToLAB(x: number, y: number, z: number): LAB;
rgbToLAB
export declare function rgbToLAB(r: number, g: number, b: number): LAB;
labToXYZ
export declare function labToXYZ(l: number, a: number, b: number): XYZ;
xyzToRGB
export declare function xyzToRGB(x: number, y: number, z: number): RGB;
labToRGB
export declare function labToRGB(l: number, a: number, b: number): RGB;
All
interface XYZ {
x: number;
y: number;
z: number;
}
interface LAB {
l: number;
a: number;
b: number;
}
interface RGB {
r: number;
g: number;
b: number;
}
interface HSL {
h: number;
s: number;
l: number;
}
export declare function rgbToHex(r: number, g: number, b: number): string;
export declare function hslToHex(h: number, s: number, l: number): string;
export declare function hslToRGB(h: number, s: number, l: number): RGB;
export declare function rgbToHSL(r: number, g: number, b: number): HSL;
export declare function hexToRGB(hex: string): RGB;
/**
* @description converts a sliced hex into it's integer equivalent
* ex: (000000,1), would take the 1st to digits 00 as hex and convert to int which
* is also 0
* but (FFFFFF,1) would give you FF /=> 255
*/
export declare function hexToInt(hex: string, index: number): number;
export declare function hexToHSL(hex: string): HSL;
/**
* @description parse a given string of value hex / rgb / hsl format
* into it's normalized hex variant
*/
export declare function parseToHex(colorstring: string): string;
/**
* Convert a (0-255) Web RGB to XYZ standards
* @param r 0-255
* @param g 0-255
* @param b 0-255
* @returns
*/
export declare function rgbToXYZ(r: number, g: number, b: number): XYZ;
export declare function xyzToLAB(x: number, y: number, z: number): LAB;
export declare function rgbToLAB(r: number, g: number, b: number): LAB;
export declare function labToXYZ(l: number, a: number, b: number): XYZ;
export declare function xyzToRGB(x: number, y: number, z: number): RGB;
export declare function labToRGB(l: number, a: number, b: number): RGB;
export {};