Trail

self:set_color

Client

Sets 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 the from color, its alpha going down to 0.
  • With to — the trail blends from from at its start to to at its end, so the two can differ in both color and alpha.

Parameters

TypeNameDescription
colorfromColor at the start of the trail as {r, g, b, a}
colortoColor at the end of the trail as {r, g, b, a}

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Fade from yellow to transparent red
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})

On this page