UNPKG

@patreon/studio

Version:

Patreon Studio Design System

63 lines (62 loc) 2.98 kB
import Color from 'color'; import type { ColorScheme } from '../../../types/color-scheme'; import type { ExtendedPalette } from '../../../types/color-system'; import type { GenerateColorPaletteProps, GenerateColorStopsProps, GenerateTonalColorStopsProps } from '../types'; /** * Generates a normalized color ramp based on an input color. Take the input color * hue and saturation, then normalizes the lightness to a bezier curve. * * @param inputColor The color to use as the base for the generated colors. * @param stopCount The number of colors to generate. * * @param hueShift The amount the hue is shifted overall * @param hueRange The range of hues to use when generating colors. * @param hueCurve The curve to use when generating hues. * @param saturationBandwidth The bandwidth of saturation. * @param saturationRange The range of saturations to use when generating colors. * @param saturationCurve The curve to use when generating saturations. * @param lightnessCurve The curve to use when generating lightnesses. * * @returns An array of colors. */ export declare function interpolateTonalColorStops({ inputColor, stopCount, hueShift, hueRange, saturationBandwidth, saturationRange, }: GenerateColorStopsProps & GenerateTonalColorStopsProps): `#${string}`[]; /** * Generates a color ramp based on an input and mix color. * * @param inputColor The color to use as the base for the generated colors. * @param stopCount The number of colors to generate. * @param mixColor The color to mix with the input color. * * @returns An array of colors. */ export declare function interpolateAccentColorStops({ inputColor, stopCount, mixColor, }: GenerateColorStopsProps & { mixColor: Color; }): `#${string}`[]; /** * Generates a color ramp based on an input color. The ramp is generated by interpolating * the alpha of the input color from 0% to 100%. * * @param inputColor The color to use as the base for the generated colors. * @param stopCount The number of colors to generate. * * @returns An array of colors. */ export declare function interpolateAlphaColorStops({ inputColor, stopCount }: GenerateColorStopsProps): `#${string}`[]; /** * Generates a complete color palette based on an input color. * * @param inputColor The color to use as the base for the generated colors. * @param config The configuration used when generating colors. * * @returns A object containing a set of color ramps. */ export declare function uncachedGenerateColorPalette({ inputColor: userInputColor, }: GenerateColorPaletteProps): ColorScheme<ExtendedPalette>; /** * Generates a complete color palette based on an input color. * * @param inputColor The color to use as the base for the generated colors. * @param config The configuration used when generating colors. * * @returns A object containing a set of color ramps. */ export declare const generateColorPalette: ({ inputColor }: GenerateColorPaletteProps) => ColorScheme<ExtendedPalette>;