/** * 判断是否 十六进制颜色值. * 输入形式可为 #fff000 #f00 * * @param String color 十六进制颜色值 * @return Boolean */ export declare function isHexColor(color: string): boolean; /** * RGB 颜色值转换为 十六进制颜色值. * r, g, 和 b 需要在 [0, 255] 范围内 * * @return String 类似#ff00ff * @param r * @param g * @param b */ export declare function rgbToHex(r: number | string, g?: number, b?: number): string; /** * Transform a HEX color to its RGB representation * @param {string} hex The color to transform * @returns The RGB representation of the passed color */ export declare function hexToRGB(hex: string): string; /** * 调整颜色的亮度和饱和度 * @param {string} color 颜色值,支持hex(#ffffff)、rgb(255,255,255)、rgba(255,255,255,0.5)格式 * @param {number} brightness 亮度调整值,范围-100到+100,正值变亮,负值变暗,0保持不变 * @param {number} saturation 饱和度调整值,范围-100到+100,可选,不传则保持原饱和度 * @returns {string} 调整后的HSL色值,格式为 "hsl(212, 57.8%, 40%)" */ export declare function adjustBrightness(color: string, brightness: number, saturation?: number): string; /** * 颜色添加透明度 * @param {stirng} color 颜色 * @param {number} opacity 透明度 0-1 * @returns {string} 转换后的颜色 */ export declare const fade: (color: string, opacity: number) => string; /** * Lightens a 6 char HEX color according to the passed percentage * @param {string} color The color to change * @param {number} amount The amount to change the color by * @returns {string} The processed color represented as HEX */ export declare function lighten(color: string, amount: number): string;