import HEX from "./hex"; import RGB from "./rgb"; import RGBA from "./rgba"; import HSL from "./hsl"; /** * Representa uma cor no formato HSLA (Hue, Saturation, Lightness, Alpha). * @class HSLA */ export default class HSLA { hue: number; saturation: number; lightness: number; alpha: number; /** * Cria uma instância de HSLA. * @param {number} hue - O matiz da cor (0-360). * @param {number} saturation - A saturação da cor (0-100). * @param {number} lightness - A luminosidade da cor (0-100). * @param {number} [alpha=1] - O canal alfa (0-1). * @example * ```ts * const transparentRed = new HSLA(0, 100, 50, 0.5); * ``` */ constructor(hue: number, saturation: number, lightness: number, alpha?: number); get h(): number; get s(): number; get l(): number; get a(): number; toString(): string; /** * Obtém a representação da cor como um vetor numérico no formato HSLA. * @returns {[number, number, number, number]} Um array no formato `[matiz, saturação, luminosidade, alfa]`. */ get vector(): [number, number, number, number]; /** * Obtém a representação da cor como uma string no formato `hsla(h, s%, l%, a)`. * @returns {string} A string da cor HSLA. * @example * ```ts * const transparentRed = new HSLA(0, 100, 50, 0.5); * console.log(transparentRed.value); // "hsla(0, 100%, 50%, 0.5)" * ``` */ get value(): string; /** * Converte a cor HSLA para sua representação RGBA. * @returns {RGBA} Um novo objeto RGBA. */ get rgba(): RGBA; /** * Converte a cor HSLA para sua representação RGB. * @returns {RGB} Um novo objeto RGB. */ get rgb(): RGB; /** * Converte a cor HSLA para sua representação HEX. * @returns {HEX} Um novo objeto HEX. */ get hex(): HEX; /** * Converte a cor HSLA para sua representação HSL, descartando o canal alfa. * @returns {HSL} Um novo objeto HSL. */ get hsl(): HSL; /** * Testa se uma string corresponde ao formato de cor HSLA. * @param {string} text - A string a ser testada. * @returns {boolean} `true` se a string for uma cor HSLA válida, caso contrário `false`. * @example * ```ts * console.log(HSLA.test("hsla(120, 100%, 50%, 0.5)")); // true * console.log(HSLA.test("hsl(120, 100%, 50%)")); // false * ``` */ static test(text: string): boolean; /** * Analisa uma string HSLA e a converte para uma instância da classe `HSLA`. * @param {string} text - A string da cor no formato HSLA (ex: "hsla(0, 100%, 50%, 0.5)"). * @returns {HSLA} Uma nova instância de `HSLA`. * @throws {Error} Lança um erro se o formato da string for inválido. * @example * ```ts * const transparentRed = HSLA.parse("hsla(0, 100%, 50%, 0.5)"); * console.log(transparentRed.alpha); // 0.5 * ``` */ static parse(text: string): HSLA; /** * Converte uma instância de `HSLA` ou um vetor de valores HSLA em uma string. * @param {HSL | [number, number, number] | [number, number, number, number]} value - A instância ou vetor `[h, s, l, a]` a ser convertido. * @returns {string} A representação da cor em formato de string HSLA. * @example * ```ts * const transparentRed = new HSLA(0, 100, 50, 0.5); * console.log(HSLA.stringify(transparentRed)); // "hsla(0, 100%, 50%, 0.5)" * * // Também funciona com um vetor de valores * console.log(HSLA.stringify([120, 100, 50, 0.8])); // "hsla(120, 100%, 50%, 0.8)" * ``` */ static stringify(value: HSL | [number, number, number] | [number, number, number, number]): string; } //# sourceMappingURL=hsla.d.ts.map