@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 HSVValues extends Color<HSVValues> {
h: number;
s: number;
v: number;
abstract toString(): any;
}
/**
* A color within the HSV color space.
*/
export declare class HSV extends HSVValues {
/**
* The RGB equivalent of this color, if provided during instantiation.
*/
rgb: RGB | undefined;
/**
* Creates a new Hue-Saturation-Value (HSV/HSB) color instance from the given ARGB integer value.
* @param argb The ARGB integer to convert to HSV.
*/
constructor(argb: number);
/**
* Creates a new Hue-Saturation-Value (HSV/HSB) color instance from the given RGB(A) color.
* @param rgb The RGB color to convert to HSV.
*/
constructor(rgb: RGB);
/**
* Creates a new Hue-Saturation-Value (HSV/HSB) color instance from the given hue, saturation, and brightness (v) values.
* @param hue The hue of the color.
* @param saturation The color's saturation value.
* @param value The color's brightness value.
* @param alpha [optional] The alpha value of the color, from 0-255. Defaults to 255, fully opaque.
*/
constructor(hue: number, saturation: number, value: number, alpha?: number);
/**
* Converts the given RGB(A) color into the Hue-Saturation-Value (HSV/HSB) format.
* @param rgb The RGB(A) color to convert into HSV.
*/
static fromRgb(rgb: RGB): Partial<HSVValues>;
/**
* Checks to see if the given color matches this color.
* @param other The new color to check against the current color.
*/
equals(other: HSV): boolean;
toString(): string;
}