@zhsz/cool-design-dv
Version:
71 lines (70 loc) • 2.82 kB
TypeScript
/**
* @description Get the Rgb value of the color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {Array<Number>|Boolean} Rgb value of the color (Invalid input will return false)
*/
export declare function getRgbValue(color: any): any;
/**
* @description Get the Rgba value of the color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {Array<Number>|Boolean} Rgba value of the color (Invalid input will return false)
*/
export declare function getRgbaValue(color: any): any;
/**
* @description Get the opacity of color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {Number|Boolean} Color opacity (Invalid input will return false)
*/
export declare function getOpacity(color: any): number | false;
/**
* @description Convert color to Rgb|Rgba color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @param {Number} opacity The opacity of color
* @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
*/
export declare function toRgb(color: any, opacity: any): string | false;
/**
* @description Convert color to Hex color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {String|Boolean} Hex color (Invalid input will return false)
*/
export declare function toHex(color: any): any;
/**
* @description Get Color from Rgb|Rgba value
* @param {Array<Number>} value Rgb|Rgba color value
* @return {String|Boolean} Rgb|Rgba color (Invalid input will return false)
*/
export declare function getColorFromRgbValue(value: any): string | false;
/**
* @description Deepen color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {Number} Percent of Deepen (1-100)
* @return {String|Boolean} Rgba color (Invalid input will return false)
*/
export declare function darken(color: any, percent?: number): string | false;
/**
* @description Brighten color
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @return {Number} Percent of brighten (1-100)
* @return {String|Boolean} Rgba color (Invalid input will return false)
*/
export declare function lighten(color: any, percent?: number): string | false;
/**
* @description Adjust color opacity
* @param {String} color Hex|Rgb|Rgba color or color keyword
* @param {Number} percent of opacity
* @return {String|Boolean} Rgba color (Invalid input will return false)
*/
export declare function fade(color: any, percent?: number): string | false;
declare const _default: {
fade: typeof fade;
toHex: typeof toHex;
toRgb: typeof toRgb;
darken: typeof darken;
lighten: typeof lighten;
getOpacity: typeof getOpacity;
getRgbValue: typeof getRgbValue;
getRgbaValue: typeof getRgbaValue;
getColorFromRgbValue: typeof getColorFromRgbValue;
};
export default _default;