-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgradient.ts
More file actions
65 lines (56 loc) · 1.75 KB
/
Copy pathgradient.ts
File metadata and controls
65 lines (56 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export type Falloff = 'gauss' | 'linear' | 'sharp';
export interface ColorPoint {
id: string;
color: string;
x: number; // percentage
y: number; // percentage
weight?: number; // 0-1, radius/intensity of the point (default 1)
falloff?: Falloff; // gaussian by default
}
export interface FilterState {
brightness: number; // 0-200
contrast: number; // 0-200
saturation: number; // 0-200
hue: number; // -180 to 180
blur: number; // smoothing px @1000px render (0-40)
grain: number; // 0-100
grainType: 'noise' | 'svg' | 'perlin';
grainBlendMode: 'normal' | 'multiply' | 'screen' | 'overlay' | 'soft-light' | 'hard-light' | 'color-dodge' | 'color-burn' | 'darken' | 'lighten' | 'difference' | 'exclusion';
}
export interface CanvasState {
width: number;
height: number;
scale: number;
ratio: string;
}
export type AnimationEasing = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
export interface AnimationState {
isPlaying: boolean;
speed: number; // multiplier
duration: number; // seconds
easing: AnimationEasing;
}
export interface GradientState {
colors: ColorPoint[];
filters: FilterState;
canvas: CanvasState;
animation: AnimationState;
adjustColorPosition: boolean;
baseTone: string; // 'auto' sentinel = OKLCH-derived dark base, else a hex
bleed: boolean; // mirror near-edge points off-canvas
}
export interface Template {
name: string;
colors: ColorPoint[];
width: number;
height: number;
}
export interface ColorPreset {
name: string;
colors: string[];
}
// Engine v2 preset: stores points (position + weight + falloff), not a flat colour array.
export interface MeshPreset {
name: string;
points: Array<{ color: string; x: number; y: number; weight?: number; falloff?: Falloff }>;
}