@a_ng_d/utils-ui-color-palette
Version:
Core utilities library for UI Color Palette - a color management plugin for design tools. This library provides the foundational color manipulation, contrast calculation, and palette generation features used in the plugin.
20 lines (19 loc) • 855 B
TypeScript
import { Channel, HexModel, RgbModel } from '../../types/color.types';
export default class Contrast {
private backgroundColor;
private textColor;
constructor({ backgroundColor, textColor, }: {
backgroundColor?: Channel;
textColor?: HexModel;
});
getWCAGContrast: () => number;
getAPCAContrast: () => number;
getWCAGScore: () => "A" | "AA" | "AAA";
getWCAGScoreColor: () => RgbModel;
getAPCAScoreColor: () => RgbModel;
getMinFontSizes: () => Array<string | number>;
getRecommendedUsage: () => "UNKNOWN" | "AVOID" | "NON_TEXT" | "SPOT_TEXT" | "HEADLINES" | "BODY_TEXT" | "CONTENT_TEXT" | "FLUENT_TEXT";
getContrastRatioForLightness: (lightness: number) => number;
getLightnessForContrastRatio: (targetRatio: number, precision?: number) => number;
}
//# sourceMappingURL=contrast.d.ts.map