Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion markdown/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ Use it to choose where to start, then jump to the detailed guides for each optio
## Recommended starting sources

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

## Common pitfalls
Expand Down
8 changes: 4 additions & 4 deletions markdown/Options/Particles.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ Particle groups let you define subsets of particles with different configs appli

When a palette is found, tsParticles imports these defaults:

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

```json
Expand All @@ -118,7 +118,7 @@ When a palette is found, tsParticles imports these defaults:
}
```

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

## reduceDuplicates

Expand Down
23 changes: 22 additions & 1 deletion markdown/Options/Particles/Palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,31 @@ When a matching palette is registered, the engine imports particle defaults:

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

## Palette data format (for custom palette authors)

Registered palettes use the `IPalette` structure:

```ts
{
name: "My Palette",
background: "#0b1020",
blendMode: "screen",
colors: {
fill: {
enable: true,
value: ["#6ee7ff", "#8b5cf6", "#f472b6"],
},
},
}
```

`colors` can also be an array of variants mixing `fill` and/or `stroke` blocks.

## Example

```json
Expand Down
4 changes: 2 additions & 2 deletions markdown/Pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Main preset catalog:

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

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

## Bundle choice

Expand Down
2 changes: 1 addition & 1 deletion markdown/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Preset usage:
## Related resources

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