UNPKG

@runejs/common

Version:

Common logging, networking, compression, and other miscellaneous functionality for RuneJS.

52 lines (51 loc) 1.77 kB
import { Color } from './color'; import { RGB } from './rgb'; export declare abstract class LABValues extends Color<LABValues> { l: number; a: number; b: number; abstract toString(): any; } /** * A color within the LAB color space. */ export declare class LAB extends LABValues { /** * The RGB equivalent of this color, if provided during instantiation. */ rgb: RGB | undefined; /** * Creates a new LAB color instance from the given ARGB integer value. * @param argb The ARGB integer to convert to LAB. */ constructor(argb: number); /** * Creates a new LAB color instance from the given RGB(A) color. * @param rgb The RGB color to convert to LAB. */ constructor(rgb: RGB); /** * Creates a new LAB color instance from the given lightness, a, and b values. * @param lightness The color's lightness. * @param a The color's A value. * @param b The color's B value. * @param alpha [optional] The alpha value of the color, from 0-255. Defaults to 255, fully opaque. */ constructor(lightness: number, a: number, b: number, alpha?: number); /** * Converts the given RGB(A) color into the LAB format. * @param rgb The RGB(A) color to convert into LAB. */ static fromRgb(rgb: RGB): Partial<LABValues>; /** * Checks to see if the given color matches this color. * @param other The new color to check against the current color. */ equals(other: LAB): boolean; /** * Calculates the difference between two colors. * @param other The new color to check against the current color. */ difference(other: LAB): number; toString(): string; }