sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
40 lines (39 loc) • 1.48 kB
TypeScript
export type ColorFormat = 'hex' | 'rgb' | 'hsl' | 'hwb';
export interface HslaColor {
h: number;
s: number;
l: number;
a: number;
}
export interface HsvaColor {
h: number;
s: number;
v: number;
a: number;
}
export declare function normalizeHsla(color: Partial<HslaColor> | undefined): HslaColor;
export declare function normalizeHsva(color: Partial<HsvaColor> | undefined): HsvaColor;
export declare function hslToRgb(color: HslaColor): {
r: number;
g: number;
b: number;
a: number;
};
export declare function rgbToHsl(red: number, green: number, blue: number, alpha?: number): HslaColor;
export declare function hslToHsv(color: HslaColor): HsvaColor;
export declare function hsvToHsl(color: HsvaColor): HslaColor;
export declare function hslToHwb(color: HslaColor): {
h: number;
w: number;
bk: number;
a: number;
};
export declare function hwbToHsl(hue: number, white: number, black: number, alpha?: number): HslaColor;
export declare function parseColor(value: string | undefined | null): {
color: HslaColor;
format: ColorFormat;
} | null;
export declare function formatColor(colorValue: Partial<HslaColor> | undefined, format: ColorFormat, showAlpha?: boolean): string;
export declare function getPreviewColor(colorValue: Partial<HslaColor> | undefined, showAlpha?: boolean): string;
export declare const defaultColorPickerValue = "#1989FA";
export declare const defaultColorPickerPresets: string[];