UNPKG

@runejs/common

Version:

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

47 lines (46 loc) 1.71 kB
import { Color } from './color'; import { RGB } from './rgb'; export declare abstract class HCLValues extends Color<HCLValues> { h: number; c: number; l: number; abstract toString(): any; } /** * A color within the HCL color space. */ export declare class HCL extends HCLValues { /** * The RGB equivalent of this color, if provided during instantiation. */ rgb: RGB | undefined; /** * Creates a new Hue-Chroma-Luminance (HCL) color instance from the given ARGB integer value. * @param argb The ARGB integer to convert to HCL. */ constructor(argb: number); /** * Creates a new Hue-Chroma-Luminance (HCL) color instance from the given RGB(A) color. * @param rgb The RGB color to convert to HCL. */ constructor(rgb: RGB); /** * Creates a new Hue-Chroma-Luminance (HCL) color instance from the given hue, chroma, and luminance values. * @param hue The hue of the color. * @param chroma The color's chroma value. * @param luminance The color's luminance value. * @param alpha [optional] The alpha value of the color, from 0-255. Defaults to 255, fully opaque. */ constructor(hue: number, chroma: number, luminance: number, alpha?: number); /** * Converts the given RGB(A) color into the Hue-Chroma-Luminance (HCL) format. * @param rgb The RGB(A) color to convert into HCL. */ static fromRgb(rgb: RGB): Partial<HCLValues>; /** * Checks to see if the given color matches this color. * @param other The new color to check against the current color. */ equals(other: HCL): boolean; toString(): string; }