Skip to content

Commit 09e9b1e

Browse files
authored
Merge pull request tsparticles#5674 from tsparticles/v4
Updated docs
2 parents 9f40a0b + 875763c commit 09e9b1e

5 files changed

Lines changed: 31 additions & 9 deletions

File tree

markdown/Options.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ Use it to choose where to start, then jump to the detailed guides for each optio
121121
## Recommended starting sources
122122

123123
- Config objects: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>
124-
- Official presets and palettes: <https://github.com/tsparticles/presets>
124+
- Official presets: <https://github.com/tsparticles/presets>
125+
- Official palettes: <https://github.com/tsparticles/palettes>
125126
- Main getting-started guide: [Pages/index](./Pages/index.md)
126127

127128
## Common pitfalls

markdown/Options/Particles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ Particle groups let you define subsets of particles with different configs appli
102102

103103
When a palette is found, tsParticles imports these defaults:
104104

105-
- `fill`: enabled/disabled according to palette settings
106-
- `fill.color.value`: palette color list when fill mode is enabled
107-
- `stroke`: one stroke per palette color when fill mode is disabled
105+
- `paint.fill`: imported from palette `colors.*.fill`
106+
- `paint.stroke`: imported from palette `colors.*.stroke`
107+
- `paint`: becomes an array when the palette declares multiple color variants
108108
- `blend`: enabled with the palette blend mode
109109

110110
```json
@@ -118,7 +118,7 @@ When a palette is found, tsParticles imports these defaults:
118118
}
119119
```
120120

121-
If you set `fill`, `stroke`, or `blend` explicitly after `palette`, those values override imported defaults.
121+
If you set `paint.fill`, `paint.stroke`, or `blend` explicitly after `palette`, those values override imported defaults.
122122

123123
## reduceDuplicates
124124

markdown/Options/Particles/Palette.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,31 @@ When a matching palette is registered, the engine imports particle defaults:
1212

1313
- `paint.fill.enable`: copied from the palette settings
1414
- `paint.fill.color.value`: set to palette colors when fill is enabled
15-
- `paint.stroke`: generated from palette colors when fill is disabled
15+
- `paint.stroke`: imported from palette stroke settings when present
16+
- `paint`: can be a single object or an array when the palette defines multiple variants
1617
- `blend.enable`: set to `true`
1718
- `blend.mode`: copied from palette blend mode
1819

20+
## Palette data format (for custom palette authors)
21+
22+
Registered palettes use the `IPalette` structure:
23+
24+
```ts
25+
{
26+
name: "My Palette",
27+
background: "#0b1020",
28+
blendMode: "screen",
29+
colors: {
30+
fill: {
31+
enable: true,
32+
value: ["#6ee7ff", "#8b5cf6", "#f472b6"],
33+
},
34+
},
35+
}
36+
```
37+
38+
`colors` can also be an array of variants mixing `fill` and/or `stroke` blocks.
39+
1940
## Example
2041

2142
```json

markdown/Pages/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Main preset catalog:
111111

112112
Use palettes when you already have the behavior you want and only need a reusable color direction.
113113

114-
- Repository directory: <https://github.com/tsparticles/presets/tree/main/palettes>
115-
- Palette-based demos: <https://particles.js.org/samples/presets/>
114+
- Repository directory: <https://github.com/tsparticles/palettes/tree/main/palettes>
115+
- Palette-based demos: <https://particles.js.org/samples/palettes/>
116116

117117
## Bundle choice
118118

markdown/Plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Preset usage:
127127
## Related resources
128128

129129
- Official presets: <https://github.com/tsparticles/presets>
130-
- Official palettes: <https://github.com/tsparticles/presets/tree/main/palettes>
130+
- Official palettes: <https://github.com/tsparticles/palettes/tree/main/palettes>
131131
- Demo configs: <https://github.com/tsparticles/tsparticles/blob/main/utils/configs/README.md>
132132
- Root options: [Options](./Options.md)
133133
- Docs introduction: [Pages/index](./Pages/index.md)

0 commit comments

Comments
 (0)