react-linear-gradient-picker
Version:
React linear gradient picker
24 lines (19 loc) • 465 B
text/typescript
import { GradientCoordinates } from './geometry';
export const GRADIENT_TYPES = {
LINEAR: 'linear',
RADIAL: 'radial',
} as const;
export type GradientType = (typeof GRADIENT_TYPES)[keyof typeof GRADIENT_TYPES];
export interface GradientConfig {
angle: number;
stops: Array<{
color: string;
offset: number;
}>;
type: GradientType;
}
export interface GradientPreview {
background: string;
angle: number;
gradient: GradientCoordinates;
}