API Reference GE Extensions flowgraph nodes vehicle Set Vehicle Colors - **Node Name:** `Set Vehicle Colors`
Node Name: Set Vehicle Colors
Category: repeat_instant
File: extensions/flowgraph/nodes/vehicle/colors.lua
Sets the primary, secondary, and tertiary paint colors on a vehicle. Each color pin uses the vehicle color format (baseColor RGBA + metallic paint parameters).
Pin Type Description vehIdnumber ID of vehicle to change color on. If empty, player vehicle is used color1color Primary color color2color Secondary color color3color Tertiary color
Old Name New Name vehIDvehId
Method Description postInit()Configures all three color pins with vehicleColor = true for the color picker UI work()Reads each color pin, creates paint data via createVehiclePaint, applies to the vehicle object, then calls setMetallicPaintData
Color Pin Vehicle Property color1obj.color (primary)color2obj.colorPalette0 (secondary)color3obj.colorPalette1 (tertiary)
The node resolves the vehicle object by ID (or defaults to the player vehicle).
For each non-nil color pin, it extracts an 8-element array: [r, g, b, a, metallic1, metallic2, metallic3, metallic4].
createVehiclePaint({x,y,z,w}, {metallic params}) produces a paint table with baseColor.
The base color is converted to linear color space via ColorF(...):asLinear4F() and assigned to the appropriate vehicle property.
All paint data is collected into a table and applied via obj:setMetallicPaintData(paintsData).
-- In a flowgraph:
-- [Color Provider (red)] → color1 → [Set Vehicle Colors] ← vehId ← [Get Player Vehicle]
--
-- Color values are 8-element arrays:
-- {r, g, b, a, metallic1, metallic2, metallic3, metallic4}
-- Programmatic equivalent:
local paint = createVehiclePaint ({x = 1 , y = 0 , z = 0 , w = 1 }, { 0.5 , 1.0 , 0.0 , 0.0 })
obj. color = ColorF (paint. baseColor [ 1 ], paint. baseColor [ 2 ], paint. baseColor [ 3 ], paint. baseColor [ 4 ]): asLinear4F ()
obj : setMetallicPaintData ({[ 1 ] = paint})
createVehiclePaint() - converts color arrays into paint data structures
ColorF:asLinear4F() - converts sRGB color to linear color space
obj:setMetallicPaintData() - applies metallic paint properties to vehicle