UNPKG

@smart-react-components/ui

Version:
28 lines (27 loc) 910 B
import { Nullable } from '@smart-react-components/core/types'; import { ColorPickerFormat } from '../types/color-picker'; /** * Converts color to string by given format. */ export declare const colorToString: (color: Color, format: ColorPickerFormat) => Nullable<string>; /** * Calculates new position of the dragger. */ export declare const calculateDraggerPosition: (e: MouseEvent, pickerEl: HTMLDivElement, draggerSize: number) => { left: number; top: number; x: number; y: number; }; /** * Converts color to the given format as string. */ export declare const convertColor: (color: Color, format: ColorPickerFormat) => Nullable<string>; /** * Checks if two given colors are equal. */ export declare const isEqual: (color1: Color, color2: Color) => boolean; /** * Checks if the given color is light. */ export declare const isLight: (color: Color, hasOpacity: boolean) => boolean;