/** * APITable * Copyright (C) 2022 APITable Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ /** * Take the incoming color as the basic color of the action, and obtain its hover and active colors according to the calculation rules * InputColor's shade in the palette * When the shade is greater than 700: hoverShade = shade - 2, activeShade = shade - 4 * When the shade is less than or equal to 700: hoverShade = shade + 1, activeShade = shade + 2 * @param color hex color */ export declare const getActionColor: (color: string) => { hover: any; active: any; }; /** * (red[500], 1) => red[600] * @param color Any Hex color in the color palette, such as red[500] * @param gap shade gap */ export declare const getNextShadeColor: (color: string, gap: number) => string; /** * * Automatically generate foreground text color according to background color: light/dark * @param background `string` Like #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param contrastThreshold `number` Contrast Threshold * @returns */ export declare function getContrastText(background: string, contrastThreshold: number): string; export declare function decomposeColor(color: string): { type: string; values: number[]; }; /** * * @param color Hex color * @param opacity */ export declare function convertHexToRGB(color: string, opacity?: number): string; export declare function getContrastRatio(foreground: string, background: string): number; export declare function getLuminance(color: string): number; /** * rgba + default white background is converted to the superimposed hex color without transparency * adjustedColor = opacity * foregroundColor + (1 - opacity) * backgroundColor * @param foregroundColor Color with alpha format,such as rgba(200, 115, 115, 0.5) * @param backgroundColor background color */ export declare const rgba2hex: (foregroundColor: string, backgroundColor?: string) => string; /** * Adjust the transparency of rgba colors * @param rgbaColor Rgba color * @param opacity */ export declare const editRgbaOpacity: (rgbaColor: string, opacity: number) => string; export declare const FourStatusColorMap: { default: string; error: string; warning: string; success: string; }; //# sourceMappingURL=color_helper.d.ts.map