getBlipColor
Client-side
Server-side
Shared
Pair: setBlipColor
This function will tell you what color a blip is. This color is only applicable to the marker blip icon (ID 0). All other icons will ignore this.
OOP Syntax Help! I don't understand this!
- Method:blip:getColor(...)
Syntax
int|false, int, int, int getBlipColor ( blip theBlip )Required arguments
- theBlip: The blip whose color you wish to get.
Returns
Returns four integers in RGBA format, with a maximum value of 255 for each. The values are, in order, red, green, blue, and alpha. Alpha decides the transparancy where 255 is opaque and 0 is fully transparent. false is returned if the blip is invalid.
- int|false: r
- int: g
- int: b
- int: a
Code Examples
shared
This example will find all the blips that exist and set them all to white if they aren't white already.
-- Retrieve a table containing all the blips that existlocal blips = getElementsByType("blip")-- Loop through the list, storing the blip from the table in the variable blipValuefor blipKey, blipValue in ipairs(blips) do -- Retrieve the blip's colors into the variables red, green, blue and alpha local red, green, blue, alpha = getBlipColor(blipValue) -- If the blip's icon isn't white already if (red ~= 255 or green ~= 255 or blue ~= 255 or alpha ~= 255) then -- Set the blip's color to white setBlipColor(blipValue, 255, 255, 255, 255) endend