@runejs/common
Version:
Common logging, networking, compression, and other miscellaneous functionality for RuneJS.
47 lines (46 loc) • 1.74 kB
TypeScript
import { Color } from './color';
import { RGB } from './rgb';
export declare abstract class HSLValues extends Color<HSLValues> {
h: number;
s: number;
l: number;
abstract toString(): any;
}
/**
* A color within the HSL color space.
*/
export declare class HSL extends HSLValues {
/**
* The RGB equivalent of this color, if provided during instantiation.
*/
rgb: RGB | undefined;
/**
* Creates a new Hue-Saturation-Lightness (HSL) color instance from the given ARGB integer value.
* @param argb The ARGB integer to convert to HSL.
*/
constructor(argb: number);
/**
* Creates a new Hue-Saturation-Lightness (HSL) color instance from the given RGB(A) color.
* @param rgb The RGB color to convert to HSL.
*/
constructor(rgb: RGB);
/**
* Creates a new Hue-Saturation-Lightness (HSL) color instance from the given hue, saturation, and lightness values.
* @param hue The hue of the color.
* @param saturation The color's saturation value.
* @param lightness The color's lightness value.
* @param alpha [optional] The alpha value of the color, from 0-255. Defaults to 255, fully opaque.
*/
constructor(hue: number, saturation: number, lightness: number, alpha?: number);
/**
* Converts the given RGB(A) color into the Hue-Saturation-Lightness (HSL) format.
* @param rgb The RGB(A) color to convert into HSL.
*/
static fromRgb(rgb: RGB): Partial<HSLValues>;
/**
* Checks to see if the given color matches this color.
* @param other The new color to check against the current color.
*/
equals(other: HSL): boolean;
toString(): string;
}