Trail
self:set_color
ClientSets the start and end colors of the trail
Syntax
local status = self:set_color(
from,
to = from
)The end color is optional.
- Without
to— the trail fades out in thefromcolor, its alpha going down to0. - With
to— the trail blends fromfromat its start totoat its end, so the two can differ in both color and alpha.
Parameters
| Type | Name | Description |
|---|---|---|
color | from | Color at the start of the trail as {r, g, b, a} |
color | to | Color at the end of the trail as {r, g, b, a} |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = particle.trail.create()
entity:set_color({1, 0.9, 0.3, 1}, {1, 0.2, 0, 0})
-- or fade out in the same color
entity:set_color({0.1, 0.5, 0.8, 0.9})