@wordpress/components
Version:
UI components for WordPress.
52 lines • 1.5 kB
TypeScript
/**
* Internal dependencies
*/
import type { DuotonePickerProps } from './types';
/**
* Object representation for a color.
*
* @typedef {Object} RGBColor
* @property {number} r Red component of the color in the range [0,1].
* @property {number} g Green component of the color in the range [0,1].
* @property {number} b Blue component of the color in the range [0,1].
*/
/**
* Calculate the brightest and darkest values from a color palette.
*
* @param palette Color palette for the theme.
*
* @return Tuple of the darkest color and brightest color.
*/
export declare function getDefaultColors(palette: DuotonePickerProps['colorPalette']): string[];
/**
* Generate a duotone gradient from a list of colors.
*
* @param colors CSS color strings.
* @param angle CSS gradient angle.
*
* @return CSS gradient string for the duotone swatch.
*/
export declare function getGradientFromCSSColors(colors?: string[], angle?: string): string;
/**
* Convert a color array to an array of color stops.
*
* @param colors CSS colors array
*
* @return Color stop information.
*/
export declare function getColorStopsFromColors(colors: string[]): {
position: number;
color: string;
}[];
/**
* Convert a color stop array to an array colors.
*
* @param colorStops Color stop information.
*
* @return CSS colors array.
*/
export declare function getColorsFromColorStops(colorStops?: {
position: number;
color: string;
}[]): string[];
//# sourceMappingURL=utils.d.ts.map