- Documentation
- Shared functions
- getVehiclePaletteColor
Function
getVehiclePaletteColor
Returns the colour with the given number from the game's vehicle palette (0-127) and its name. The RGB values are exactly what the Definitive Edition draws, so they suit e.g. a colour preview in a paint shop.
Syntax
int, int, int, string getVehiclePaletteColor(int id)Arguments
idint- Colour number 0-127.
Returns
r, g, b and the colour name, or false for a bad number.
Example
for id = 0, 7 do
local r, g, b, name = getVehiclePaletteColor(id)
outputDebugString(("%d: %s (%d, %d, %d)"):format(id, name, r, g, b))
end
See also
getNearestVehiclePaletteColorFinds the colour in the game's vehicle palette (0-127) most similar to the given RGB colour. Useful when a player picks a colour with a free colour picker and the script wants to store it as a palette number.setVehicleColorIdSets a vehicle's colours using numbers from the San Andreas vehicle palette (0-127), as in the classic game and the carcols files. Number 0 is black, 1 white, 3 red, 6 yellow… (getVehiclePaletteColorgives names and colours). Passing one number sets both main colours to it.