@nauverse/color-to-hsla
Version:
🧪 A tiny URL builder library for TypeScript.
35 lines (30 loc) • 874 B
TypeScript
/**
* Converts a color value to HSLA format.
*
* @param format - The color value to convert. It can be either a string or an object.
* @returns The color value in HSLA format.
* @throws Error if the format is not a string or an object, or if the argument cannot be parsed.
*/
export declare function colorToHSLA(format: string | IColorObject): HSLA;
declare interface HSLA {
h: number;
s: number;
l: number;
a: number;
}
/**
* Converts an HSLA color object to a string representation.
* @param hsla - The HSLA color object to convert.
* @returns The string representation of the HSLA color.
*/
export declare function hslaToString(hsla: HSLA): string;
declare interface IColorObject {
h?: number;
s?: number;
l?: number;
a?: number;
r?: number;
g?: number;
b?: number;
}
export { }