import { HSLAColor, HSLColor, RGBAColor, RGBColor } from "./models.mjs"; //#region src/color/instance.d.ts /** * A color that is represented in multiple color formats */ declare class Color { #private; /** * A property to identify this as a Color instance, used for type checking * * @internal */ private readonly $color; /** * Get the alpha channel _(opacity)_ of the color * * @returns Current alpha channel value between `0` and `1` */ get alpha(): number; /** * Set the alpha channel _(opacity)_ of the color, as: * * - A number between `0` and `1`, where `0` is fully transparent and `1` is fully opaque * - A number between `0` and `100`, where `0` is fully transparent and `100` is fully opaque * * @param value New alpha channel value */ set alpha(value: number); /** * Get the color as a hex color string * * _Hex color string is returned with no `#`-prefix or alpha channel (opacity)_ * * @returns Current color as a hex color string */ get hex(): string; /** * Set the color from a hex color string * * - `#`-prefix is optional * - Alpha channel _(opacity)_ will be ignored * * @param value New hex color string */ set hex(value: string); /** * Get the color as a hex color with an alpha channel _(opacity)_ * * _Hex color string is returned with alpha channel (opacity), but without `#`-prefix_ * * @returns Current color as a hex color string */ get hexa(): string; /** * Set the color from a hex color string with an alpha channel _(opacity)_ * * - `#`-prefix is optional * - Alpha channel _(opacity)_ will be respected * * @param value New hex color string */ set hexa(value: string); /** * Get the color as an _HSL_ color * * @returns Current color as an _HSL_ color */ get hsl(): HSLColor; /** * Set colors from an _HSL_ color * * @param value New _HSL_ color */ set hsl(value: HSLColor); /** * Get the color as an _HSLA_ color * * @returns Current color as an _HSLA_ color */ get hsla(): HSLAColor; /** * Set colors and alpha from an _HSLA_ color * * @param value New _HSLA_ color */ set hsla(value: HSLAColor); /** * Get the color as an _RGB_ color * * @returns Current color as an _RGB_ color */ get rgb(): RGBColor; /** * Set colors from an _RGB_ color * * @param value New _RGB_ color */ set rgb(value: RGBColor); /** * Get the color as an _RGBA_ color * * @returns Current color as an _RGBA_ color */ get rgba(): RGBAColor; /** * Set colors and alpha from an _RGBA_ color * * @param value New _RGBA_ color */ set rgba(value: RGBAColor); constructor(value: unknown); /** * Get the color as a hex string * * @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_ * @returns Hex color string */ toHexString(alpha?: boolean): string; /** * Get the color as an _HSL(A)_ string * * @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_ * @returns _HSL(A)_ color string */ toHslString(alpha?: boolean): string; /** * Get the color as an _RGB(A)_ string * * @param alpha Include alpha channel _(opacity)_? _(defaults to `false`)_ * @returns _RGB(A)_ color string */ toRgbString(alpha?: boolean): string; /** * Get the color as a hex color string * * @returns Hex color string */ toString(): string; } //#endregion export { Color };