vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
30 lines (29 loc) • 1.06 kB
TypeScript
import { I_Color, I_HSV, I_RGB } from './types';
/**
* 将RGB单个分量(0-255)转换为2位的十六进制字符串
*/
export declare const componentToHex: (value: number) => string;
/**
* 根据HUE色相值生成RGB颜色值HUE(范围为 0-360)
*/
export declare const HUEtoRGB: (h: number) => I_RGB;
/**
* 将RGB颜色对象转换为十六进制颜色字符串(不包含alpha通道)
*/
export declare const RGBtoHEX: (color: I_RGB) => string;
/**
* 将十六进制颜色字符串转换为RGB对象(不包含alpha通道)
*/
export declare const HEXtoRGB: (hex: string) => I_RGB;
/**
* 将RGB颜色对象转换为HSV颜色模型(色相、饱和度、明度)
*/
export declare const RGBtoHSV: ({ r, g, b }: I_RGB) => I_HSV;
/**
* 将HSV颜色模型转换为RGB颜色对象
*/
export declare const HSVtoRGB: ({ h, s, v }: I_HSV) => I_RGB;
/**
* 通用颜色解析函数|支持#HEX|rgb()|rgba()和颜色关键字|返回标准颜色对象(包含 RGB、十六进制、透明度等)
*/
export declare const parseColor: (color: string) => I_Color;