git-hash-art 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ALGORITHM.md +323 -270
- package/CHANGELOG.md +18 -0
- package/bin/cli.js +17 -14
- package/bin/generateExamples.js +6 -14
- package/bin/generateVersionComparison.js +353 -0
- package/dist/browser.js +2398 -225
- package/dist/browser.js.map +1 -1
- package/dist/main.js +2398 -225
- package/dist/main.js.map +1 -1
- package/dist/module.js +2398 -225
- package/dist/module.js.map +1 -1
- package/package.json +2 -1
- package/src/lib/archetypes.ts +119 -0
- package/src/lib/canvas/colors.ts +110 -2
- package/src/lib/canvas/draw.ts +359 -9
- package/src/lib/canvas/shapes/affinity.ts +624 -0
- package/src/lib/canvas/shapes/procedural.ts +395 -32
- package/src/lib/render.ts +531 -155
package/ALGORITHM.md
CHANGED
|
@@ -4,49 +4,70 @@ This document describes the deterministic art generation pipeline used by `git-h
|
|
|
4
4
|
|
|
5
5
|
## Pipeline Overview
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```text
|
|
8
8
|
Hash String
|
|
9
9
|
│
|
|
10
10
|
├─► Seed (mulberry32 PRNG)
|
|
11
11
|
│
|
|
12
|
-
├─► Archetype Selection (1 of
|
|
12
|
+
├─► Archetype Selection (1 of 17 visual personalities)
|
|
13
|
+
│
|
|
14
|
+
├─► Color Scheme (palette mode + temperature mode + contrast enforcement)
|
|
15
|
+
│ └─► Color Hierarchy (dominant 60% / secondary 25% / accent 15%)
|
|
13
16
|
│
|
|
14
|
-
├─►
|
|
17
|
+
├─► Shape Palette (affinity-curated primary / supporting / accent shapes)
|
|
18
|
+
│
|
|
19
|
+
├─► Color Grade Selection (unified tone for post-processing)
|
|
15
20
|
│
|
|
16
21
|
└─► Rendering Pipeline (parameters overridden by archetype)
|
|
17
22
|
│
|
|
18
23
|
0. Archetype Override (gridSize, layers, opacity, sizes, styles)
|
|
24
|
+
0b. Color Hierarchy (dominant/secondary/accent weighting)
|
|
25
|
+
0c. Shape Palette (curated via affinity graph)
|
|
26
|
+
0d. Color Grade (hue + intensity for final tone)
|
|
27
|
+
0e. Light Direction (consistent shadow angle)
|
|
19
28
|
1. Background Layer (7 styles: radial, linear, solid, multi-stop)
|
|
29
|
+
└─ Gradient Mesh Overlay (3-4 radial color control points)
|
|
20
30
|
1a. Background Luminance → contrast enforcement threshold
|
|
21
|
-
1b. Layered Background (
|
|
31
|
+
1b. Layered Background (archetype-coherent shapes + concentric rings)
|
|
32
|
+
1c. Background Pattern Layer (dot grid / diagonal lines / tessellation)
|
|
22
33
|
2. Composition Mode Selection
|
|
23
34
|
2b. Symmetry Mode Selection (none / bilateral / quad)
|
|
24
35
|
3. Focal Points (rule-of-thirds biased) + Void Zones
|
|
25
36
|
4. Flow Field Initialization
|
|
26
|
-
4b. Hero Shape (
|
|
37
|
+
4b. Hero Shape (palette-aware, affinity-styled)
|
|
27
38
|
5. Shape Layers (× N layers, archetype-tuned)
|
|
28
39
|
│ ├─ Blend Mode (per-layer compositing)
|
|
29
|
-
│ ├─ Render Style (
|
|
40
|
+
│ ├─ Render Style (affinity-aware per shape)
|
|
41
|
+
│ ├─ Depth-of-Field (stroke thinning + contrast reduction on far layers)
|
|
30
42
|
│ ├─ Position (composition mode + focal bias + density check)
|
|
31
|
-
│ ├─ Shape Selection (
|
|
43
|
+
│ ├─ Shape Selection (palette-driven with size constraints)
|
|
44
|
+
│ ├─ Hero Avoidance Field (nearby shapes orient toward hero)
|
|
32
45
|
│ ├─ Contrast Enforcement (ensure readability vs background)
|
|
33
46
|
│ ├─ Atmospheric Depth (desaturation on later layers)
|
|
34
47
|
│ ├─ Temperature Contrast (foreground opposite to background)
|
|
35
|
-
│ ├─ Styling (transparency, glow, gradients,
|
|
48
|
+
│ ├─ Styling (transparency, glow, gradients, HSL jitter)
|
|
36
49
|
│ ├─ Organic Edges (~15% watercolor bleed)
|
|
37
|
-
│
|
|
38
|
-
|
|
50
|
+
│ ├─ 5a. Tangent Placement (~25% nudge toward nearest shape edge)
|
|
51
|
+
│ ├─ 5b. Shape Mirroring (~40% of basic shapes get reflected copies)
|
|
52
|
+
│ ├─ 5c. Size Echo (~20% of large shapes spawn trailing copies)
|
|
53
|
+
│ ├─ 5d. Recursive Nesting (~15% of large shapes, palette-aware)
|
|
54
|
+
│ └─ 5e. Shape Constellations (~12% of large shapes, pre-composed groups)
|
|
55
|
+
6. Flow-Line Pass (variable color, pressure, branching)
|
|
39
56
|
6b. Symmetry Mirroring (bilateral-x, bilateral-y, or quad)
|
|
40
57
|
7. Noise Texture Overlay
|
|
41
58
|
8. Vignette (radial edge darkening)
|
|
42
59
|
9. Organic Connecting Curves
|
|
60
|
+
10. Post-Processing
|
|
61
|
+
├─ Color Grading (unified tone overlay)
|
|
62
|
+
├─ Chromatic Aberration (neon/cosmic/ethereal only)
|
|
63
|
+
└─ Bloom (neon/cosmic only)
|
|
43
64
|
```
|
|
44
65
|
|
|
45
66
|
## 1. Deterministic RNG
|
|
46
67
|
|
|
47
68
|
All randomness flows from a single **mulberry32** PRNG seeded by hashing the full input string:
|
|
48
69
|
|
|
49
|
-
```
|
|
70
|
+
```text
|
|
50
71
|
seed = hash(gitHash) → mulberry32 state
|
|
51
72
|
rng() → float in [0, 1)
|
|
52
73
|
```
|
|
@@ -55,12 +76,12 @@ The old approach extracted 2-char hex pairs from the hash (only ~20 unique value
|
|
|
55
76
|
|
|
56
77
|
## 2. Archetype System
|
|
57
78
|
|
|
58
|
-
Before any rendering begins, the hash deterministically selects one of
|
|
79
|
+
Before any rendering begins, the hash deterministically selects one of 17 **visual archetypes** — fundamentally different rendering personalities that override key parameters. This is the primary mechanism for visual diversity: two hashes that select different archetypes will look like they came from entirely different generators.
|
|
59
80
|
|
|
60
81
|
Each archetype controls:
|
|
61
82
|
|
|
62
83
|
| Parameter | Effect |
|
|
63
|
-
|
|
84
|
+
| --------- | ------ |
|
|
64
85
|
| `gridSize` | Shape density (2 = sparse, 9 = packed) |
|
|
65
86
|
| `layers` | Rendering depth (2 = flat, 5 = deep) |
|
|
66
87
|
| `baseOpacity` / `opacityReduction` | Transparency character |
|
|
@@ -71,340 +92,372 @@ Each archetype controls:
|
|
|
71
92
|
| `flowLineMultiplier` | Flow line density (0 = none, 4 = heavy) |
|
|
72
93
|
| `heroShape` | Whether to draw a dominant focal shape |
|
|
73
94
|
| `glowMultiplier` | Glow probability scaling (0 = none, 3 = heavy) |
|
|
74
|
-
| `sizePower` | Size distribution curve (0.5 = uniform, 2.
|
|
95
|
+
| `sizePower` | Size distribution curve (0.5 = uniform, 2.8 = many tiny) |
|
|
75
96
|
|
|
76
|
-
### The
|
|
97
|
+
### The 17 Archetypes
|
|
77
98
|
|
|
78
|
-
| Archetype |
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
99
|
+
| Archetype | Grid | Layers | Background | Palette | Key Styles | Flow | Hero | Character |
|
|
100
|
+
| --------- | ---- | ------ | ---------- | ------- | ---------- | ---- | ---- | --------- |
|
|
101
|
+
| dense-chaotic | 9 | 5 | radial-dark | harmonious | fill-and-stroke, watercolor | 2.5× | no | Packed, layered, energetic |
|
|
102
|
+
| minimal-spacious | 2 | 2 | solid-light | duotone | fill-and-stroke, stroke-only, incomplete | 0.3× | yes | Clean, airy, few large shapes |
|
|
103
|
+
| organic-flow | 4 | 3 | radial-dark | earth | watercolor, fill-only, incomplete | 4× | no | Natural, flowing, muted tones |
|
|
104
|
+
| geometric-precision | 6 | 3 | solid-dark | high-contrast | stroke-only, dashed, double-stroke, hatched | 0× | no | Sharp, structured, no flow lines |
|
|
105
|
+
| ethereal | 7 | 5 | radial-light | pastel-light | watercolor, incomplete | 1.5× | yes | Soft, glowing, dreamlike |
|
|
106
|
+
| bold-graphic | 2 | 2 | linear-diagonal | duotone | fill-and-stroke, double-stroke | 0× | yes | Poster-like, large shapes |
|
|
107
|
+
| neon-glow | 5 | 4 | solid-dark | neon | stroke-only, double-stroke, dashed | 2× | yes | Bright outlines on black, heavy glow |
|
|
108
|
+
| monochrome-ink | 6 | 3 | solid-light | monochrome | hatched, incomplete, stroke-only | 1.5× | no | Pen-and-ink, single hue |
|
|
109
|
+
| cosmic | 8 | 5 | radial-dark | neon | fill-only, watercolor | 3× | yes | Deep space, many tiny shapes, glow |
|
|
110
|
+
| watercolor-wash | 3 | 3 | radial-light | harmonious | watercolor, fill-only, incomplete | 0.5× | no | Soft washes, large shapes, low opacity |
|
|
111
|
+
| op-art | 8 | 2 | solid-light | high-contrast | fill-and-stroke, stroke-only, dashed | 0× | no | Dense, high-contrast, uniform sizes |
|
|
112
|
+
| collage | 4 | 3 | solid-light | duotone | fill-and-stroke, fill-only, double-stroke | 0× | yes | Overlapping, medium-large shapes |
|
|
113
|
+
| classic | 5 | 4 | radial-dark | harmonious | fill-and-stroke, watercolor | 1× | yes | Balanced, the original look |
|
|
114
|
+
| shattered-glass | 8 | 3 | solid-dark | high-contrast | fill-and-stroke, stroke-only, fill-only | 0× | no | Angular fragments, sharp edges, mosaic-like |
|
|
115
|
+
| botanical | 4 | 4 | radial-light | earth | watercolor, fill-only, incomplete | 3× | yes | Organic tendrils, flowing forms, natural tones |
|
|
116
|
+
| stipple-portrait | 9 | 2 | solid-light | monochrome | stipple, fill-only, hatched | 0× | no | Dense dot textures, pointillist, single hue |
|
|
117
|
+
| celestial | 7 | 5 | radial-dark | neon | fill-only, watercolor, stroke-only, incomplete | 2× | yes | Cosmic crescents, sacred geometry, heavy glow |
|
|
90
118
|
|
|
91
|
-
|
|
119
|
+
#### New Archetype Details
|
|
92
120
|
|
|
93
|
-
|
|
121
|
+
**shattered-glass** — Favors angular, fragmented shapes (shardField, voronoiCell, penroseTile, diamond, triangle, ngon). Organic shapes like blobs and clouds are filtered from the palette. High contrast on a dark background with no flow lines creates a mosaic of sharp-edged fragments.
|
|
122
|
+
|
|
123
|
+
**botanical** — Boosts organic shapes (tendril, cloudForm, blob, crescent, rose, inkSplat) for a natural, garden-like feel. Earth palette on a light radial background with heavy flow lines (3×) creates flowing, vine-like compositions.
|
|
94
124
|
|
|
95
|
-
|
|
125
|
+
**stipple-portrait** — Extremely dense (grid 9) with very small shapes (5–120px) and a steep size power curve (2.8) producing many tiny dots. Monochrome palette with stipple and hatched styles creates a pointillist texture. No flow lines or hero shape.
|
|
96
126
|
|
|
97
|
-
|
|
98
|
-
|---------|--------|---------|
|
|
99
|
-
| Base | `color-scheme` lib, hue = seed % 360, hash-driven scheme type | Primary shape colors |
|
|
100
|
-
| Complementary | hue = seed + 180°, contrasting variation | Contrast accents |
|
|
101
|
-
| Triadic | hue = seed + 120° | Additional variety |
|
|
127
|
+
**celestial** — Boosts sacred geometry and cosmic shapes (crescent, geodesicDome, mandala, flowerOfLife, spirograph, fibonacciSpiral). Neon palette on dark background with heavy glow (2.5×) and deep layering (5 layers) creates a starfield-like composition with luminous geometric forms.
|
|
102
128
|
|
|
103
|
-
|
|
129
|
+
## 3. Color Scheme
|
|
130
|
+
|
|
131
|
+
Color generation uses the `color-scheme` library seeded from the hash, then applies archetype-specific palette modes.
|
|
104
132
|
|
|
105
133
|
### Palette Modes
|
|
106
134
|
|
|
107
|
-
|
|
135
|
+
| Mode | Description |
|
|
136
|
+
| ---- | ----------- |
|
|
137
|
+
| harmonious | Full palette from the scheme — the default |
|
|
138
|
+
| monochrome | Single hue, varying lightness |
|
|
139
|
+
| duotone | Two colors only |
|
|
140
|
+
| neon | High saturation on dark backgrounds |
|
|
141
|
+
| pastel-light | Soft pastels on light backgrounds |
|
|
142
|
+
| earth | Muted warm naturals |
|
|
143
|
+
| high-contrast | Black + white + one accent color |
|
|
144
|
+
|
|
145
|
+
### Color Hierarchy
|
|
146
|
+
|
|
147
|
+
After generating the raw palette, colors are organized into a **hierarchy** with weighted selection:
|
|
148
|
+
|
|
149
|
+
- **Dominant (60%)** — the most-used color, selected as the palette entry closest to the average hue
|
|
150
|
+
- **Secondary (25%)** — the color most distant from the dominant
|
|
151
|
+
- **Accent (15%)** — a remaining color for visual punctuation
|
|
152
|
+
|
|
153
|
+
`pickHierarchyColor(hierarchy, rng)` rolls against these weights so compositions naturally converge on a dominant tone without being monotonous.
|
|
108
154
|
|
|
109
|
-
|
|
110
|
-
|------|--------|-----------|
|
|
111
|
-
| **harmonious** | Full base + complementary + triadic | Rich, balanced (default) |
|
|
112
|
-
| **monochrome** | Single hue, 5 lightness steps | Elegant, focused |
|
|
113
|
-
| **duotone** | Two contrasting hues + tints | Bold, graphic |
|
|
114
|
-
| **neon** | 4 hues at full saturation | Electric, vivid |
|
|
115
|
-
| **pastel-light** | 4 hues at low saturation, high lightness | Soft, dreamy |
|
|
116
|
-
| **earth** | Warm muted naturals (browns, olives, sage) | Organic, grounded |
|
|
117
|
-
| **high-contrast** | Black + white + one accent | Technical, stark |
|
|
155
|
+
### HSL Jitter
|
|
118
156
|
|
|
119
|
-
|
|
157
|
+
Color variation uses **HSL-space jitter** (`jitterColorHSL`) instead of the old RGB approach. This produces perceptually uniform shifts — a ±10° hue rotation and ±8% saturation/lightness shift feels natural, whereas the equivalent RGB jitter could accidentally desaturate or muddy colors.
|
|
158
|
+
|
|
159
|
+
### Positional Color
|
|
160
|
+
|
|
161
|
+
Shapes receive color based on their position relative to the canvas center:
|
|
162
|
+
- **Center (< 35% radius):** biased toward the dominant color
|
|
163
|
+
- **Middle (35–70%):** weighted random from the full hierarchy
|
|
164
|
+
- **Edges (> 70%):** biased toward secondary and accent colors
|
|
165
|
+
|
|
166
|
+
This creates a natural color gradient across the composition without explicit gradient code.
|
|
120
167
|
|
|
121
168
|
### Temperature Contrast
|
|
122
169
|
|
|
123
|
-
The
|
|
170
|
+
The scheme detects whether the background leans warm or cool, then shifts foreground shapes toward the opposite temperature. This ensures shapes always "pop" against their background.
|
|
171
|
+
|
|
172
|
+
### Contrast Enforcement
|
|
173
|
+
|
|
174
|
+
Every shape color is checked against the background luminance. If the contrast ratio is too low, the color is lightened or darkened to ensure visibility.
|
|
175
|
+
|
|
176
|
+
## 4. Shape Affinity System
|
|
177
|
+
|
|
178
|
+
Not all shapes look equally good at all sizes or in all combinations. The affinity system replaces naive random shape selection with intentional curation.
|
|
179
|
+
|
|
180
|
+
### Shape Inventory
|
|
181
|
+
|
|
182
|
+
The system includes 40+ shapes across 4 categories:
|
|
183
|
+
|
|
184
|
+
| Category | Shapes |
|
|
185
|
+
| -------- | ------ |
|
|
186
|
+
| Basic (9) | circle, square, triangle, hexagon, star, jacked-star, heart, diamond, cube |
|
|
187
|
+
| Complex (7) | platonicSolid, fibonacciSpiral, islamicPattern, celticKnot, merkaba, mandala, fractal |
|
|
188
|
+
| Sacred (8) | flowerOfLife, treeOfLife, metatronsCube, sriYantra, seedOfLife, vesicaPiscis, torus, eggOfLife |
|
|
189
|
+
| Procedural (18) | blob, ngon, lissajous, superellipse, spirograph, waveRing, rose, shardField, voronoiCell, crescent, tendril, cloudForm, inkSplat, geodesicDome, penroseTile, reuleauxTriangle, dotCluster, crosshatchPatch |
|
|
190
|
+
|
|
191
|
+
### Quality Tiers
|
|
192
|
+
|
|
193
|
+
Each shape has a profile with:
|
|
124
194
|
|
|
125
|
-
|
|
|
126
|
-
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
195
|
+
| Field | Purpose |
|
|
196
|
+
| ----- | ------- |
|
|
197
|
+
| `tier` (1–3) | Visual quality rating. Tier 1 shapes look good at any size; Tier 3 shapes need specific conditions |
|
|
198
|
+
| `minSizeFraction` / `maxSizeFraction` | Size bounds as fraction of `maxShapeSize` — prevents shapes from being drawn at sizes where they look bad |
|
|
199
|
+
| `affinities` | List of shapes this one composes well with |
|
|
200
|
+
| `category` | basic, complex, sacred, or procedural |
|
|
201
|
+
| `heroCandidate` | Whether the shape works as a dominant focal element |
|
|
202
|
+
| `bestStyles` | Render styles that suit this shape (e.g., sacred geometry looks best as stroke-only) |
|
|
130
203
|
|
|
131
|
-
|
|
204
|
+
### Shape Palette Construction
|
|
132
205
|
|
|
133
|
-
|
|
206
|
+
`buildShapePalette(rng, shapeNames, archetypeName)` builds a curated set:
|
|
134
207
|
|
|
135
|
-
|
|
208
|
+
1. **Seed selection:** Pick a Tier 1 hero-candidate shape as the seed
|
|
209
|
+
2. **Primary (5 shapes):** The seed + its direct affinities (Tier 1–2 only)
|
|
210
|
+
3. **Supporting (6 shapes):** Affinities-of-affinities + same-category Tier 1–2 shapes
|
|
211
|
+
4. **Accents (3 shapes):** Tier 1–2 shapes from *other* categories for contrast
|
|
136
212
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| `default` | Balanced, neutral |
|
|
213
|
+
Archetype-specific overrides apply:
|
|
214
|
+
- `geometric-precision` removes organic/procedural shapes from primary
|
|
215
|
+
- `organic-flow` boosts blobs and wave rings
|
|
216
|
+
- `shattered-glass` boosts angular shapes (shardField, voronoiCell, penroseTile), removes blobs/clouds
|
|
217
|
+
- `botanical` boosts organic shapes (tendril, cloudForm, crescent, rose, inkSplat)
|
|
218
|
+
- `stipple-portrait` boosts dot-friendly shapes (dotCluster, circle, crosshatchPatch)
|
|
219
|
+
- `celestial` boosts sacred/cosmic shapes (crescent, geodesicDome, mandala, flowerOfLife)
|
|
145
220
|
|
|
146
|
-
|
|
221
|
+
### Palette-Driven Selection
|
|
147
222
|
|
|
148
|
-
|
|
223
|
+
During rendering, `pickShapeFromPalette(palette, rng, sizeFraction)` selects shapes with weighted probability:
|
|
224
|
+
- **Primary: ~60%**, Supporting: ~30%, Accent: ~10%
|
|
225
|
+
- Shapes whose size constraints don't match the current `sizeFraction` are filtered out before selection
|
|
149
226
|
|
|
150
|
-
-
|
|
151
|
-
- **`jitterColor(hex, rng, amount)`** — applies ±amount RGB jitter per channel for organic variation
|
|
152
|
-
- **`desaturate(hex, amount)`** — blends toward luminance gray for atmospheric depth
|
|
153
|
-
- **`shiftTemperature(hex, target, amount)`** — shifts hue toward warm (orange) or cool (blue)
|
|
154
|
-
- **Positional blending** — shape fill color is biased by canvas position, creating smooth color flow across the image
|
|
227
|
+
### Affinity-Aware Styling
|
|
155
228
|
|
|
156
|
-
|
|
229
|
+
`pickStyleForShape(shapeName, layerStyle, rng)` gives each shape a 70% chance of using one of its `bestStyles` instead of the layer's default style. This means sacred geometry naturally renders as stroke-only while blobs naturally render as watercolor.
|
|
157
230
|
|
|
158
|
-
|
|
231
|
+
## 5. Background Rendering
|
|
232
|
+
|
|
233
|
+
### Base Background
|
|
234
|
+
|
|
235
|
+
The archetype's `backgroundStyle` selects one of 7 modes:
|
|
159
236
|
|
|
160
237
|
| Style | Description |
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
238
|
+
| ----- | ----------- |
|
|
239
|
+
| radial-dark | Dark radial gradient from center outward (default) |
|
|
240
|
+
| radial-light | Light center (#f0ece4) fading to the palette background |
|
|
241
|
+
| linear-horizontal | Left-to-right gradient |
|
|
242
|
+
| linear-diagonal | Corner-to-corner gradient with midpoint return |
|
|
243
|
+
| solid-dark | Flat dark fill |
|
|
244
|
+
| solid-light | Flat off-white (#f5f2eb) |
|
|
245
|
+
| multi-stop | 3–4 color gradient using palette colors |
|
|
169
246
|
|
|
170
|
-
|
|
247
|
+
### Gradient Mesh Overlay
|
|
171
248
|
|
|
172
|
-
|
|
249
|
+
After the base background, 3–4 radial color control points are placed at random positions using `soft-light` compositing. Each point uses a hierarchy color at very low opacity (8–14%). This adds subtle color variation and depth to what would otherwise be a flat or simple gradient background.
|
|
173
250
|
|
|
174
|
-
|
|
251
|
+
### Layered Background Shapes
|
|
175
252
|
|
|
176
|
-
-
|
|
177
|
-
- **Concentric rings** — 2-4 rings emanating from center at ~2-5% opacity, adding structure without competing with foreground shapes
|
|
253
|
+
Large, nearly-transparent shapes (3–7) are drawn in `soft-light` mode at 3–8% opacity. The shape type is archetype-coherent: geometric archetypes (`geometric-precision`, `op-art`) use rectangles; all others use circles. Subtle concentric rings radiate from the center at ~2–5% opacity to add structure.
|
|
178
254
|
|
|
179
|
-
|
|
255
|
+
### Background Pattern Layer
|
|
180
256
|
|
|
181
|
-
|
|
257
|
+
~60% of images receive a subtle background pattern drawn in `soft-light` at 2–6% opacity, simulating textured paper:
|
|
182
258
|
|
|
183
|
-
|
|
259
|
+
| Pattern | Description |
|
|
260
|
+
| ------- | ----------- |
|
|
261
|
+
| Dot grid (⅓ chance) | Evenly spaced tiny dots across the canvas |
|
|
262
|
+
| Diagonal lines (⅓ chance) | Parallel diagonal lines at 0.5px width |
|
|
263
|
+
| Hexagonal tessellation (⅓ chance) | Honeycomb grid of tiny hexagons, stroke-only |
|
|
184
264
|
|
|
185
|
-
|
|
186
|
-
|------|-------------|
|
|
187
|
-
| **Radial** | Shapes emanate from the center with distance following a power curve (denser near center) |
|
|
188
|
-
| **Flow-field** | Random positions; shapes are rotated to align with a hash-derived vector field |
|
|
189
|
-
| **Spiral** | Shapes follow a multi-turn spiral path outward from center with slight scatter |
|
|
190
|
-
| **Grid-subdivision** | Canvas is divided into cells; shapes are placed randomly within cells |
|
|
191
|
-
| **Clustered** | 3-5 cluster centers are generated; shapes scatter around the nearest cluster |
|
|
265
|
+
The pattern spacing scales with canvas size (1.5–3% of the shorter dimension). This adds tactile depth without competing with foreground shapes.
|
|
192
266
|
|
|
193
|
-
|
|
267
|
+
### Background Luminance
|
|
194
268
|
|
|
195
|
-
|
|
269
|
+
The average luminance of the two background colors is computed and stored. This value drives contrast enforcement for all foreground shapes — ensuring they remain visible regardless of background brightness.
|
|
196
270
|
|
|
197
|
-
|
|
271
|
+
## 6. Composition & Symmetry
|
|
198
272
|
|
|
199
|
-
|
|
200
|
-
|------|-------------|--------|
|
|
201
|
-
| `bilateral-x` | 10% | Left half mirrored onto right half |
|
|
202
|
-
| `bilateral-y` | 10% | Top half mirrored onto bottom half |
|
|
203
|
-
| `quad` | 5% | Both axes mirrored (4-fold symmetry) |
|
|
204
|
-
| `none` | 75% | No mirroring |
|
|
273
|
+
### Composition Modes
|
|
205
274
|
|
|
206
|
-
|
|
275
|
+
Each image uses one of 5 composition strategies for shape placement:
|
|
207
276
|
|
|
208
|
-
|
|
277
|
+
| Mode | Behavior |
|
|
278
|
+
| ---- | -------- |
|
|
279
|
+
| radial | Shapes cluster around center with power-curve falloff |
|
|
280
|
+
| spiral | Shapes follow a multi-turn spiral from center outward |
|
|
281
|
+
| grid-subdivision | Canvas divided into 3–5 cells; shapes placed within random cells |
|
|
282
|
+
| clustered | 3–5 cluster centers; shapes scatter around the nearest cluster |
|
|
283
|
+
| flow-field | Uniform random placement (rotation driven by flow field) |
|
|
209
284
|
|
|
210
|
-
|
|
285
|
+
### Symmetry
|
|
211
286
|
|
|
212
|
-
|
|
287
|
+
~25% of hashes trigger symmetry mirroring, applied after all shapes and flow lines are drawn:
|
|
288
|
+
- **bilateral-x (10%):** Left half mirrored to right
|
|
289
|
+
- **bilateral-y (10%):** Top half mirrored to bottom
|
|
290
|
+
- **quad (5%):** Both axes mirrored
|
|
213
291
|
|
|
214
|
-
|
|
215
|
-
- Uses sacred/complex shape types (flower of life, fibonacci spiral, merkaba, fractal, etc.)
|
|
216
|
-
- Is sized at 80-130% of the maximum shape size for visual dominance
|
|
217
|
-
- Gets glow effects, gradient fills, and often watercolor rendering
|
|
218
|
-
- Is drawn before the main shape layers so other shapes layer on top of it
|
|
219
|
-
- Creates a clear center of gravity that anchors the entire composition
|
|
292
|
+
Symmetry is applied by drawing the canvas image onto itself with `scale(-1, 1)` or `scale(1, -1)` transforms.
|
|
220
293
|
|
|
221
|
-
|
|
294
|
+
## 7. Focal Points & Void Zones
|
|
222
295
|
|
|
223
|
-
1
|
|
296
|
+
1–2 **focal points** are placed with 70% bias toward rule-of-thirds intersections (the remaining 30% are placed randomly within the central 60% of the canvas). Each focal point has a `strength` (0.3–0.7) that pulls nearby shapes toward it via `applyFocalBias`.
|
|
224
297
|
|
|
225
|
-
|
|
298
|
+
1–2 **void zones** are placed randomly. Shapes landing inside a void zone have an 85% chance of being skipped, creating breathing room in the composition.
|
|
226
299
|
|
|
227
|
-
|
|
300
|
+
## 8. Hero Shape
|
|
228
301
|
|
|
229
|
-
|
|
302
|
+
When the archetype enables `heroShape` and the RNG roll passes (60% chance), a dominant focal element is drawn at the first focal point:
|
|
230
303
|
|
|
231
|
-
|
|
304
|
+
- Shape is selected from palette hero candidates (Tier 1, `heroCandidate: true`)
|
|
305
|
+
- Size is 80–130% of `adjustedMaxSize`
|
|
306
|
+
- Style is chosen from the shape's `bestStyles` via its affinity profile
|
|
307
|
+
- Fill uses the dominant hierarchy color; stroke uses the accent
|
|
308
|
+
- Glow radius is 12–32px (scaled)
|
|
309
|
+
- The hero's position and size are stored for the **hero avoidance field**
|
|
232
310
|
|
|
233
|
-
|
|
311
|
+
## 9. Shape Layers
|
|
234
312
|
|
|
235
|
-
|
|
236
|
-
|----------|----------|
|
|
237
|
-
| Opacity | Decays gently per layer (0.7 → 0.58 → 0.46 → 0.34), minimum 0.15 |
|
|
238
|
-
| Size scale | Later layers use progressively smaller shapes (×0.85, ×0.70, ×0.55) |
|
|
239
|
-
| Shape weights | Early layers favor basic shapes; later layers favor complex/sacred |
|
|
240
|
-
| Per-shape opacity | Additional random jitter (50-100% of layer opacity) |
|
|
241
|
-
| Blend mode | Each layer gets a hash-derived `globalCompositeOperation` (see below) |
|
|
242
|
-
| Render style | Each layer has a dominant render style (60% from archetype preferences, 40% random); 30% of shapes pick their own |
|
|
243
|
-
| Atmospheric depth | Later layers desaturate colors by up to 30%, simulating distance |
|
|
313
|
+
The core of the image: `layers` passes (archetype-controlled, typically 2–5), each drawing `gridSize² × 1.5` shapes plus up to 30% random extra.
|
|
244
314
|
|
|
245
|
-
###
|
|
315
|
+
### Per-Layer Setup
|
|
246
316
|
|
|
247
|
-
|
|
317
|
+
- **Blend mode:** Random compositing mode (`source-over`, `multiply`, `screen`, `overlay`, `soft-light`, etc.)
|
|
318
|
+
- **Render style bias:** 60% chance of using an archetype-preferred style; 40% random
|
|
319
|
+
- **Opacity:** Decreases per layer (`baseOpacity - layer × opacityReduction`, floor 0.15)
|
|
320
|
+
- **Size scale:** Decreases 15% per layer (later layers = smaller shapes)
|
|
321
|
+
- **Atmospheric desaturation:** Later layers are progressively desaturated (up to 30%) to simulate depth
|
|
322
|
+
- **Depth-of-field:** Later layers get thinner strokes (down to 40% of base width) and reduced contrast (up to 20% opacity reduction), simulating camera focus falloff
|
|
248
323
|
|
|
249
|
-
###
|
|
324
|
+
### Per-Shape Pipeline
|
|
250
325
|
|
|
251
|
-
|
|
326
|
+
For each shape in a layer:
|
|
252
327
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
328
|
+
1. **Position:** Composition mode generates a candidate position, then `applyFocalBias` pulls it toward the nearest focal point
|
|
329
|
+
2. **Void check:** 85% skip chance if inside a void zone
|
|
330
|
+
3. **Density check:** If local density exceeds 15% of `shapesPerLayer`, 60% skip chance
|
|
331
|
+
4. **Size:** Power-curve distribution controlled by `archetype.sizePower` — higher values produce more small shapes
|
|
332
|
+
5. **Shape selection:** `pickShapeFromPalette` with size-constraint filtering
|
|
333
|
+
6. **Rotation:** Flow-field angle in flow-field mode (±15° jitter); random otherwise
|
|
334
|
+
7. **Hero avoidance:** Shapes within 1.5× the hero's size orient toward it (rotation blended 40% toward the angle-to-hero)
|
|
335
|
+
8. **Color:** Positional color from hierarchy + HSL jitter, with atmospheric desaturation and temperature contrast applied
|
|
336
|
+
9. **Contrast enforcement:** Fill and stroke colors checked against background luminance
|
|
337
|
+
10. **Styling:** Affinity-aware render style, optional glow (sacred shapes 45% base chance × archetype multiplier), optional radial gradient fill (30% chance)
|
|
338
|
+
11. **Organic edges:** 15% of `fill-and-stroke` shapes are promoted to `watercolor` style
|
|
339
|
+
12. **Light direction:** Non-glowing shapes get a subtle shadow offset along the consistent light angle
|
|
263
340
|
|
|
264
|
-
|
|
341
|
+
### 5a. Tangent Placement
|
|
265
342
|
|
|
266
|
-
|
|
343
|
+
~25% of shapes are nudged toward the nearest previously-placed shape so their edges "kiss." The algorithm finds the nearest shape, computes the target distance (sum of half-sizes), and repositions the current shape along the angle between them. This creates organic clustering where shapes feel intentionally arranged rather than randomly scattered.
|
|
267
344
|
|
|
268
|
-
|
|
345
|
+
### 5b. Shape Mirroring
|
|
269
346
|
|
|
270
|
-
|
|
347
|
+
Basic shapes (circle, triangle, square, hexagon, star, diamond, crescent, penroseTile, reuleauxTriangle) that are larger than 20% of max size have a ~40% chance of receiving a mirrored reflection. Four mirror axes are available:
|
|
271
348
|
|
|
272
|
-
|
|
349
|
+
| Axis | Probability | Effect |
|
|
350
|
+
| ---- | ----------- | ------ |
|
|
351
|
+
| horizontal | 15% | Reflected below with inverted rotation |
|
|
352
|
+
| vertical | 12% | Reflected to the right with 180° rotation offset |
|
|
353
|
+
| diagonal | 8% | Reflected along 45° axis with 90° rotation offset |
|
|
354
|
+
| radial-4 | 5% | Four copies at 90° intervals around the center |
|
|
273
355
|
|
|
274
|
-
|
|
275
|
-
|----------|--------|-------------|-------------|
|
|
276
|
-
| **Basic** | circle, square, triangle, hexagon, diamond, cube | High weight | Low weight |
|
|
277
|
-
| **Complex** | star, platonic solid, fibonacci spiral, islamic pattern, celtic knot, merkaba, fractal | Medium | Medium-high |
|
|
278
|
-
| **Sacred** | mandala, flower of life, tree of life, Metatron's cube, Sri Yantra, seed of life, vesica piscis, torus, egg of life | Low | High |
|
|
279
|
-
| **Procedural** | blob, ngon, lissajous, superellipse, spirograph, waveRing, rose | Medium (always present) | Medium-high |
|
|
356
|
+
The mirror copy is drawn at 70% opacity and 95% size (decreasing for radial-4), creating a subtle symmetry effect without perfect duplication.
|
|
280
357
|
|
|
281
|
-
|
|
358
|
+
### 5c. Size Echo
|
|
282
359
|
|
|
283
|
-
|
|
360
|
+
~20% of shapes larger than half `adjustedMaxSize` spawn 2–3 trailing copies along a random direction. Each echo is progressively smaller (30% → 22% → 14% of parent size) and more transparent, creating a motion-trail effect.
|
|
284
361
|
|
|
285
|
-
|
|
362
|
+
### 5d. Recursive Nesting
|
|
286
363
|
|
|
287
|
-
|
|
288
|
-
- **Dark backgrounds** — foreground colors are lightened and saturated
|
|
364
|
+
~15% of shapes larger than 40% of `adjustedMaxSize` receive 1–3 inner shapes. Inner shapes are selected from the palette via `pickShapeFromPalette` at the nested size fraction, and styled with their own affinity-aware render style.
|
|
289
365
|
|
|
290
|
-
|
|
366
|
+
### 5e. Shape Constellations
|
|
291
367
|
|
|
292
|
-
|
|
368
|
+
~12% of shapes larger than 35% of `adjustedMaxSize` trigger a **constellation** — a pre-composed group of shapes placed as a unit. The entire group is rotated by a random angle for variety. Five constellation types are available:
|
|
293
369
|
|
|
294
|
-
|
|
370
|
+
| Constellation | Description |
|
|
371
|
+
| ------------- | ----------- |
|
|
372
|
+
| flanked-triangle | Central triangle with two smaller circles on either side |
|
|
373
|
+
| hexagon-ring | 5–6 hexagons arranged in a ring |
|
|
374
|
+
| spiral-dots | 7–11 circles spiraling outward with decreasing size |
|
|
375
|
+
| diamond-cluster | 4 diamonds in a cardinal arrangement with progressive rotation |
|
|
376
|
+
| crescent-pair | Two crescents facing each other |
|
|
295
377
|
|
|
296
|
-
|
|
378
|
+
Each member shape uses hierarchy colors with HSL jitter and affinity-aware render styles. Members that fall outside the canvas bounds are skipped.
|
|
297
379
|
|
|
298
|
-
|
|
380
|
+
## 10. Render Styles
|
|
299
381
|
|
|
300
|
-
|
|
301
|
-
- **Color jitter** — ±8% RGB variation on fills, ±5% on strokes, so no two shapes using the "same" palette color are pixel-identical
|
|
302
|
-
- **Positional color** — fill color is biased by the shape's canvas position, creating smooth color flow
|
|
303
|
-
- **Glow effect** — 45% of sacred shapes and 20% of others get a `shadowBlur` glow (8-28px scaled), with glow color at 60% opacity
|
|
304
|
-
- **Gradient fill** — ~30% of shapes get a radial gradient between two jittered palette colors instead of a flat fill
|
|
305
|
-
- **Variable stroke width** — 0.5-2.5px scaled to canvas size
|
|
382
|
+
Each shape is drawn using one of 14 render styles:
|
|
306
383
|
|
|
307
|
-
|
|
384
|
+
| Style | Description |
|
|
385
|
+
| ----- | ----------- |
|
|
386
|
+
| fill-and-stroke | Standard fill + outline (default) |
|
|
387
|
+
| fill-only | Solid fill, no outline |
|
|
388
|
+
| stroke-only | Ghost fill at 30% opacity + full outline |
|
|
389
|
+
| double-stroke | Fill + thick outer stroke at 50% opacity + thin inner stroke in fill color |
|
|
390
|
+
| dashed | Fill + dashed outline (dash = 5% of size, gap = 3%) |
|
|
391
|
+
| watercolor | Multi-pass: base wash (scaled up 8%), radial-bleed offset washes, edge darkening via inner lighter fill, delicate thin stroke |
|
|
392
|
+
| hatched | 30% opacity fill + clipped cross-hatch lines (parallel + optional perpendicular) + 50% opacity outline |
|
|
393
|
+
| incomplete | 25% opacity fill + long-dash stroke simulating a partially drawn outline (60–85% completeness) |
|
|
394
|
+
| stipple | Ghost fill at 15% + clipped dot grid with jittered positions and variable dot sizes |
|
|
395
|
+
| stencil | Negative-space cutout: fills a bounding rectangle, then erases the shape via destination-out compositing |
|
|
396
|
+
| noise-grain | 25% base tint + clipped procedural noise (random black/white dots at 15–50% opacity, variable sizes) |
|
|
397
|
+
| wood-grain | 20% base tint + clipped parallel wavy lines at a random angle, simulating wood texture |
|
|
398
|
+
| marble-vein | 35% soft base + clipped branching vein lines that drift and fork, simulating marble stone |
|
|
399
|
+
| fabric-weave | 15% ghost base + clipped interlocking horizontal and vertical thread lines at alternating opacities |
|
|
308
400
|
|
|
309
|
-
|
|
310
|
-
- Inner shapes are drawn at the parent's position with small random offsets
|
|
311
|
-
- They use more complex/sacred shape types (layer ratio biased +0.3)
|
|
312
|
-
- Sized at 15-40% of the parent
|
|
313
|
-
- More transparent than the parent layer
|
|
401
|
+
### Texture Fill Details
|
|
314
402
|
|
|
315
|
-
|
|
403
|
+
The 4 new texture fills (noise-grain, wood-grain, marble-vein, fabric-weave) all work by:
|
|
404
|
+
1. Drawing a low-opacity base fill to tint the shape
|
|
405
|
+
2. Clipping to the shape boundary via `ctx.clip()`
|
|
406
|
+
3. Drawing the procedural texture pattern within the clipped region
|
|
407
|
+
4. Adding a subtle outline stroke on top
|
|
316
408
|
|
|
317
|
-
|
|
409
|
+
**noise-grain** scatters random-sized dots (black or white) across the shape at variable opacity, creating a film-grain or sandpaper texture. Dot spacing scales with shape size.
|
|
318
410
|
|
|
319
|
-
-
|
|
320
|
-
- At each step, direction is determined by the flow field angle at that position plus slight random wobble
|
|
321
|
-
- Lines stop if they leave the canvas bounds
|
|
322
|
-
- **Tapered width** — each line starts at 1-4px and tapers to 20% of its starting width by the end, simulating a brush stroke that lifts off the canvas
|
|
323
|
-
- **Tapered opacity** — alpha also decays along the stroke, creating natural fade-out
|
|
324
|
-
- Individual segments are drawn with `lineCap: "round"` for smooth joins
|
|
411
|
+
**wood-grain** draws parallel wavy lines at a random angle. The wave frequency (3–8 cycles) and amplitude (1–4% of size) create organic undulation. Line spacing is ~3.5% of shape size.
|
|
325
412
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
413
|
+
**marble-vein** draws 2–4 main veins that drift randomly downward, with ~20% chance per step of spawning a thinner branch vein. This creates the characteristic forking pattern of natural marble.
|
|
414
|
+
|
|
415
|
+
**fabric-weave** draws horizontal threads at full spacing, then vertical threads at half-spacing offsets, creating an over-under weave pattern. The two thread directions use different opacities (55% vs 45%) and colors (stroke vs fill) for visual distinction.
|
|
416
|
+
|
|
417
|
+
### Watercolor Detail
|
|
418
|
+
|
|
419
|
+
The watercolor style simulates wet media through 4 passes:
|
|
420
|
+
1. **Base wash:** Shape drawn at 108% scale, 15% opacity — soft bleed beyond the boundary
|
|
421
|
+
2. **Offset washes:** 4–5 passes with radial displacement (random angle, up to 5% of size) — organic edge irregularity
|
|
422
|
+
3. **Edge darkening:** Shape drawn at 85–93% scale with lightened fill — simulates pigment pooling at boundaries where the inner area dries lighter
|
|
423
|
+
4. **Delicate stroke:** Thin outline (60% of normal width) at 25% opacity
|
|
424
|
+
|
|
425
|
+
## 11. Flow Lines
|
|
426
|
+
|
|
427
|
+
Flow lines follow a sinusoidal vector field defined by `flowAngle(x, y)`. The archetype's `flowLineMultiplier` controls count (0× = none, up to 4× = heavy).
|
|
428
|
+
|
|
429
|
+
Each flow line:
|
|
430
|
+
- Starts at a random position
|
|
431
|
+
- Takes 30–70 steps along the flow field (±0.3 radians jitter per step)
|
|
432
|
+
- **Variable color:** Interpolates between two hierarchy colors along the stroke length
|
|
433
|
+
- **Pressure simulation:** Line width oscillates sinusoidally (frequency 2–6 cycles, amplitude ±40%) to simulate pen pressure
|
|
434
|
+
- **Taper:** Width and opacity decrease toward the end (80% taper over the stroke length)
|
|
435
|
+
- **Branching:** ~12% chance per step (between steps 5 and N-10) to spawn a child stroke at ±0.3–0.8 radians, 40% width, 5–15 steps, 60% parent opacity
|
|
436
|
+
|
|
437
|
+
## 12. Post-Processing
|
|
438
|
+
|
|
439
|
+
After all shapes, flow lines, and symmetry mirroring:
|
|
440
|
+
|
|
441
|
+
### Noise Texture
|
|
442
|
+
|
|
443
|
+
Deterministic noise (separate RNG seeded from hash + salt 777) scatters single-pixel dots across the canvas. Density scales with canvas area (~1 dot per 800px²). Each dot is black or white at 1–4% opacity, adding subtle film grain.
|
|
444
|
+
|
|
445
|
+
### Vignette
|
|
446
|
+
|
|
447
|
+
A radial gradient darkens the edges: transparent at center, ramping to 25–45% black at the corners. This draws the eye inward toward the focal points.
|
|
448
|
+
|
|
449
|
+
### Organic Connecting Curves
|
|
450
|
+
|
|
451
|
+
Quadratic Bézier curves connect random pairs of placed shapes. The control point is offset perpendicular to the line between shapes by up to 40% of their distance, creating organic arcs. Count scales with canvas area (~8 per megapixel). Drawn at 6–16% opacity using hierarchy colors.
|
|
452
|
+
|
|
453
|
+
### Color Grading
|
|
454
|
+
|
|
455
|
+
A `soft-light` overlay in a single hue (random, 40% saturation, 50% lightness) at low intensity (grade intensity × 25% opacity). This unifies the image's color temperature — like applying a photo filter.
|
|
456
|
+
|
|
457
|
+
### Chromatic Aberration
|
|
458
|
+
|
|
459
|
+
Only for `neon-glow`, `cosmic`, and `ethereal` archetypes. The canvas is drawn onto itself with a small horizontal offset (±2px scaled) using `screen` compositing at 3% opacity. This creates a subtle RGB fringing effect at high-contrast edges.
|
|
460
|
+
|
|
461
|
+
### Bloom
|
|
330
462
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
A dedicated noise RNG (seeded separately from the main RNG to avoid affecting shape generation) renders thousands of 1px dots across the canvas:
|
|
334
|
-
|
|
335
|
-
- Density: ~1 dot per 800 square pixels
|
|
336
|
-
- Each dot is either black or white (50/50)
|
|
337
|
-
- Very low opacity (1-4%)
|
|
338
|
-
- Creates subtle film-grain texture that adds organic depth
|
|
339
|
-
|
|
340
|
-
## 9b. Vignette
|
|
341
|
-
|
|
342
|
-
A radial gradient overlay darkens the edges of the canvas, drawing the viewer's eye toward the center:
|
|
343
|
-
|
|
344
|
-
- Strength varies by hash: 25-45% maximum edge darkening
|
|
345
|
-
- The vignette begins fading at 60% of the canvas radius from center
|
|
346
|
-
- Applied after noise but before connecting curves, so the curves remain visible at edges
|
|
347
|
-
- Creates a natural "spotlight" effect that makes compositions feel more focused and photographic
|
|
348
|
-
|
|
349
|
-
## 10. Organic Connecting Curves
|
|
350
|
-
|
|
351
|
-
Quadratic bezier curves connect nearby shapes:
|
|
352
|
-
|
|
353
|
-
- Number of curves scales with canvas area (~8 per megapixel)
|
|
354
|
-
- Each curve connects two shapes that were drawn near each other in sequence
|
|
355
|
-
- Control points are offset perpendicular to the connecting line with random bulge
|
|
356
|
-
- Drawn at low opacity (6-16%) with palette colors at 30% alpha
|
|
357
|
-
|
|
358
|
-
## Shape Implementations
|
|
359
|
-
|
|
360
|
-
### Basic Shapes
|
|
361
|
-
Standard geometric primitives drawn as canvas paths (beginPath → moveTo/lineTo/arc → closePath). The draw pipeline calls `fill()` and `stroke()` after the path is defined.
|
|
362
|
-
|
|
363
|
-
### Complex Shapes
|
|
364
|
-
More intricate geometry including:
|
|
365
|
-
- **Platonic solids** — 2D projections with all edges drawn between vertices
|
|
366
|
-
- **Fibonacci spiral** — iterative arc segments following the golden ratio
|
|
367
|
-
- **Islamic pattern** — 8-pointed star grid at intersections
|
|
368
|
-
- **Celtic knot** — bezier over/under weaving pattern
|
|
369
|
-
- **Mandala** — concentric circles with radial lines
|
|
370
|
-
- **Fractal tree** — recursive branching at ±30° with 0.7× length decay
|
|
371
|
-
|
|
372
|
-
### Sacred Geometry
|
|
373
|
-
Mathematically precise sacred geometry patterns:
|
|
374
|
-
- **Flower of Life** — 7 overlapping circles in hexagonal arrangement
|
|
375
|
-
- **Tree of Life** — 10 Sephirot nodes with connecting paths
|
|
376
|
-
- **Metatron's Cube** — 13 vertices (center + inner/outer hexagons) fully connected
|
|
377
|
-
- **Sri Yantra** — 9 interlocking triangles at two radii
|
|
378
|
-
- **Seed of Life** — 7 circles (same as Flower of Life, different scale)
|
|
379
|
-
- **Vesica Piscis** — two overlapping circles
|
|
380
|
-
- **Torus** — 2D projection of a torus via line segments
|
|
381
|
-
- **Egg of Life** — 7 circles in tight hexagonal packing
|
|
382
|
-
|
|
383
|
-
### Procedural Shapes
|
|
384
|
-
Hash-derived shapes whose geometry is generated from the RNG. Every hash produces unique shapes that don't exist in any other generation:
|
|
385
|
-
|
|
386
|
-
| Shape | Algorithm | Hash Controls |
|
|
387
|
-
|-------|-----------|---------------|
|
|
388
|
-
| **Blob** | Smooth closed curve via quadratic bezier through 5-9 control points arranged around a circle | Number of lobes (5-9), radius jitter per lobe (50-100%) |
|
|
389
|
-
| **Ngon** | Irregular polygon with independent vertex displacement | Side count (3-12), vertex jitter amount (10-50%) |
|
|
390
|
-
| **Lissajous** | Parametric curve `x = sin(a*t + φ), y = sin(b*t)` | Frequency ratios a,b (1-5 each), phase offset φ |
|
|
391
|
-
| **Superellipse** | `|x|^n + |y|^n = 1` rendered parametrically | Exponent n: 0.3 (spiky astroid) → 2 (circle) → 5 (rounded rectangle) |
|
|
392
|
-
| **Spirograph** | Hypotrochoid curve `(R-r)cos(t) + d*cos((R-r)t/r)` | Inner radius ratio r (0.2-0.8), pen distance d (0.3-1.0) |
|
|
393
|
-
| **Wave Ring** | Concentric rings with sinusoidal radial displacement | Ring count (2-5), wave frequency (3-14), amplitude (5-20%) |
|
|
394
|
-
| **Rose** | Polar rose curve `r = cos(k*θ)` | Petal parameter k (2-7), producing k or 2k petals |
|
|
395
|
-
|
|
396
|
-
## Configuration
|
|
397
|
-
|
|
398
|
-
All parameters are exposed via `GenerationConfig`:
|
|
399
|
-
|
|
400
|
-
| Parameter | Default | Effect |
|
|
401
|
-
|-----------|---------|--------|
|
|
402
|
-
| `width` | 2048 | Canvas width in pixels |
|
|
403
|
-
| `height` | 2048 | Canvas height in pixels |
|
|
404
|
-
| `gridSize` | 5 | Base shape count = gridSize² × 1.5 |
|
|
405
|
-
| `layers` | 4 | Number of rendering layers |
|
|
406
|
-
| `minShapeSize` | 30 | Minimum shape size (scaled to canvas) |
|
|
407
|
-
| `maxShapeSize` | 400 | Maximum shape size (scaled to canvas) |
|
|
408
|
-
| `baseOpacity` | 0.7 | First layer opacity |
|
|
409
|
-
| `opacityReduction` | 0.12 | Opacity decay per layer |
|
|
410
|
-
| `shapesPerLayer` | auto | Override auto-calculated shape count |
|
|
463
|
+
Only for `neon-glow` and `cosmic` archetypes. The canvas is redrawn with `shadowBlur` at 30px (scaled) and white shadow color, composited via `screen` at 8% opacity. This creates a soft glow around bright areas.
|