getColorFilter
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function is used to get the values of color filtering.
Tip
Normally the game is adding these colors to a screen to simulate weather effects. Sometimes it can be important to disable these effects. You can get rid of the effects by calling setColorFilter with zero values.
Syntax
int, int, int, int, int, int, int, int getColorFilter ( bool isOriginal )Required Arguments
- isOriginal: A bool indicates if the return values of color filter are GTASA original or changed by setColorFilter . If this is set to false , the return values would be the color filter that is currently being used.
Returns
- int: value1
- int: value2
- int: value3
- int: value4
- int: value5
- int: value6
- int: value7
- int: value8
Returns 8 integers , of which the first 4 indicate the color (R,G,B,A) of color filter A, and the last 4 indicate the color (R,G,B,A) of color filter B.
Code Examples
shared
This example corrects color of dxDrawMaterialLine3D. But this method has some limit.
local testRT = dxCreateRenderTarget(32,32,true)
x,y,z = 0, 0, 4size = 4addEventHandler("onClientRender", root, function() dxSetRenderTarget(testRT,true) dxDrawRectangle(0,0,32,32,tocolor(255,255,255,255)) dxSetRenderTarget()
local aR,aG,aB,aA,bR,bG,bB,bA = getColorFilter(false) --Get current color filter local cR,cG,cB = 127/255+(aR*aA+bR*bA)/65535*0.5, 127/255+(aG*aA+bG*bA)/65535*0.5, 127/255+(aB*aA+bB*bA)/65535*0.5 --Calculate the result color of color filter dxDrawMaterialLine3D(x+size, y+size, z-0.95, x-size, y-size, z-0.95,false, testRT, size*2,tocolor(127, 127, 127, 255)) dxDrawMaterialLine3D(x+size+20, y+size, z-0.95, x-size+20, y-size, z-0.95,false, testRT, size*2,tocolor(127/cR, 127/cG, 127/cB, 255))end)See Also
World Functions
- areTrafficLightsLocked
- createSWATRope
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getBirdsEnabled
- getCloudsEnabled
- getColorFilter
- getCoronaReflectionsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGravity
- getGroundPosition
- getHeatHaze
- getInteriorFurnitureEnabled
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getJetpackWeaponEnabled
- getMinuteDuration
- getMoonSize
- getNearClipDistance
- getOcclusionsEnabled
- getPedsLODDistance
- getRainLevel
- getRoofPosition
- getScreenFromWorldPosition
- getSkyGradient
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getVehiclesLODDistance
- getWeather
- getWindVelocity
- getWorldFromScreenPosition
- getWorldProperty
- getZoneName
- isAmbientSoundEnabled
- isGarageOpen
- isLineOfSightClear
- isTimeFrozen
- isVolumetricShadowsEnabled
- isWorldSoundEnabled
- isWorldSpecialPropertyEnabled
- processLineAgainstMesh
- processLineOfSight
- removeGameWorld
- removeWorldModel
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetNearClipDistance
- resetPedsLODDistance
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetTimeFrozen
- resetVehiclesLODDistance
- resetVolumetricShadows
- resetWindVelocity
- resetWorldProperties
- resetWorldProperty
- resetWorldSounds
- restoreAllWorldModels
- restoreGameWorld
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setAmbientSoundEnabled
- setBirdsEnabled
- setCloudsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGrainLevel
- setGrainMultiplier
- setGravity
- setHeatHaze
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setJetpackMaxHeight
- setJetpackWeaponEnabled
- setMinuteDuration
- setMoonSize
- setNearClipDistance
- setOcclusionsEnabled
- setPedsLODDistance
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTimeFrozen
- setTrafficLightsLocked
- setTrafficLightState
- setVehiclesLODDistance
- setVolumetricShadowsEnabled
- setWeather
- setWeatherBlended
- setWindVelocity
- setWorldProperty
- setWorldSoundEnabled
- setWorldSpecialPropertyEnabled
- testLineAgainstWater
- testSphereAgainstWorld