import { type IColor, type IColorPalette, type IColorPaletteItem, type IRgbColorValue } from "@gooddata/sdk-model"; import { type DataViewFacade, type IHeaderPredicate, type IMappingHeader } from "@gooddata/sdk-ui"; import { type IColorMapping, type IPatternObject } from "./types.js"; /** * @internal */ export declare function getRgbFromWebColor(input: string): IRgbColorValue | null; /** * @internal */ export declare function parseRGBColorCode(color: string): { R: number; G: number; B: number; }; /** * Source: * http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color-or-rgb-and-blend-colors * * @internal */ export declare function getLighterColor(color: string, percent: number): string; /** * Darkens a rgb() color by the given percent (0..1). * It uses the reverse algorithm of getLighterColor (color made lighter by it can be negated). * @internal */ export declare function getDarkerColor(color: string, percent: number): string; /** * @internal */ export declare function getLighterColorFromRGB(color: IRgbColorValue, percent: number): IRgbColorValue; /** * @internal */ export declare function normalizeColorToRGB(color: string): string; /** * @internal */ export declare function getColorPaletteFromColors(colors: string[]): IColorPalette; /** * @internal */ export declare function getRgbString(color: IColorPaletteItem): string; /** * @internal */ export declare function isCustomPalette(palette: IColorPalette): boolean; /** * @internal */ export declare function getColorFromMapping(mappingHeader: IMappingHeader, colorMapping: IColorMapping[] | undefined, dv: DataViewFacade): IColor | undefined; /** * Compares two GUID strings, normalizing purely-numeric GUIDs so that * zero-padded values match their unpadded counterparts (e.g. "05" matches "5"). * * IDE (YAML) deployments may store palette GUIDs with zero-padding while the * runtime palette uses unpadded indices. Without this normalization the * strict-equality check fails for IDs below 10 and `isValidMappedColor` * rejects the stored color, causing the configuration to be reset. * * @internal */ export declare function guidEquals(a: string, b: string): boolean; /** * @internal */ export declare function getColorByGuid(colorPalette: IColorPalette, guid: string, index: number): IRgbColorValue; /** * @internal */ export declare function getRgbStringFromRGB(color: IRgbColorValue): string; /** * @internal */ export declare function parseRGBString(color: string): IRgbColorValue | null; /** * Computes WCAG contrast ratio between two colors. * Accepts any web color supported by `getRgbFromWebColor` (hex, rgb/rgba, named colors). * * @internal */ export declare function getContrastRatio(colorA: string, colorB: string): number; /** * Creates new predicate for mapping colors to chart entities: * * - if attribute header, URI is expected to match testValue * - otherwise (attr or measure descriptor) expecting local identifier match * * @param testValue - right hand side to test against * @public */ export declare function getColorMappingPredicate(testValue: string): IHeaderPredicate; /** * Applies color properties preferences. If palette is specified and non-empty, it is returned. Otherwise * non-empty colors are transformed into a palette and returned. If all else fails, default color palette * is returned * * @internal */ export declare function getValidColorPalette(colors?: string[], colorPalette?: IColorPalette): IColorPalette; /** * @internal */ export declare const ColorUtils: { getColorByGuid: typeof getColorByGuid; getColorMappingPredicate: typeof getColorMappingPredicate; }; /** * Test whether the color is a pattern object. * @param color - tested color object * * @internal */ export declare function isPatternObject(color: string | IPatternObject | undefined): color is IPatternObject; //# sourceMappingURL=color.d.ts.map