natiny_particles_set_colors
void natiny_particles_set_colors(NatinyParticles particles, const NatinyColor* colors, uint32_t count);
Sets how a particle's colour and alpha change over its life, as evenly spaced colours from birth to death.
Parameters
| Name | Type | Description |
|---|---|---|
particles |
NatinyParticles |
Particle system handle from natiny_particles_create |
colors |
const NatinyColor* |
Colours, copied; may be NULL when count is 0 |
count |
uint32_t |
Number of colours, 0 to 8; 0 removes the gradient |
Example
const NatinyColor colors[] = {
natiny_color_from_hex("#FFEE88FF"),
natiny_color_from_hex("#FF6622CC"),
natiny_color_from_hex("#33333300"),
};
natiny_particles_set_colors(fire, colors, 3);
Notes
- A
countabove8is clamped to8.