import { type ColorFormats } from "tinycolor2"; export type ColorNotation = "hex" | "rgb" | "hsl"; export declare const COLOR_NOTATIONS: readonly ColorNotation[]; /** * The picker's working color. * * @remarks * Held as hue, saturation and lightness because that is what the controls address. Kept as channels * instead, turning the wheel at an extreme lightness would not come back to the hue it started from: * every gray, black and white is the same hue once written as channels. */ export interface IColorPickerValue extends ColorFormats.HSL { alpha: number; } /** * A point on the wheel, as a fraction of its radius from the middle, in screen orientation. */ export interface IColorWheelPoint { x: number; y: number; } export declare function colorPickerValueFromRgb(rgb: ColorFormats.RGB | ColorFormats.RGBA): IColorPickerValue; export declare function colorPickerValueToRgba(value: IColorPickerValue): ColorFormats.RGBA; export declare function areColorPickerValuesEqual(left: IColorPickerValue, right: IColorPickerValue): boolean; /** * Writes the value in the given notation. * * @remarks * Opacity is written only where there is some, so an opaque color reads as the plain three-channel * form. */ export declare function formatColorPickerValue(value: IColorPickerValue, notation: ColorNotation): string; /** * Whether text can be applied to the document as it stands, mid-typing. * * @remarks * Text is applied as it is typed, so parsing is not enough: a parser reads three hex digits as a * color, a fourth as opacity, and `hsl(210, 53%, 1` — closed or not — as white. */ export declare function canApplyColorPickerValueWhileTyping(text: string): boolean; /** * Reads a color from text. * * @remarks * A gray states no hue, and a parser reports 0 for it, so the current hue is carried over. Taken * literally the wheel would swing to red the moment someone typed a gray. */ export declare function parseColorPickerValue(text: string, current: IColorPickerValue): IColorPickerValue | undefined; /** * Reads a point on the wheel as a hue and a saturation. * * @remarks * Past the rim the saturation clamps rather than the gesture being dropped, which keeps a drag live * when the pointer leaves the wheel. */ export declare function colorPickerValueFromWheel(point: IColorWheelPoint, current: IColorPickerValue): IColorPickerValue; export declare function colorPickerValueToWheel(value: IColorPickerValue): IColorWheelPoint; //# sourceMappingURL=colorValue.d.ts.map