Skip to content

Color

Fields


Name Type Ranges
r float R channel of the color
g float G channel of the color
b float B channel of the color
a float A channel of the color

Functions


Color()

Return value

Name Type Description
color Color Returns a Color ( 0, 0, 0, 0 )
Example

1
2
3
4
5
6
7
Cheat.RegisterCallback("render", function()

  local col = Color()
  Renderer:DrawFilledRect(0,0,100,100,col,0.0)


end)
This will draw a fully transparent rectangle because the alpha channel is 0.


Color()

Parameters

Parameter Type Description
r float R channel of the color
g float G channel of the color
b float B channel of the color
a float A channel of the color

Return value

Name Type Description
color Color Returns a Color ( r, g, b, a )
Example

1
2
3
4
5
6
7
Cheat.RegisterCallback("render", function()

  local col = Color(1,1,1,0.5)
  Renderer:DrawFilledRect(0,0,100,100,col,0.0)


end)
This will draw a white, semi-transparent rectangle.


Color()

Parameters

Parameter Type Description
r int R channel of the color
g int G channel of the color
b int B channel of the color
a int A channel of the color

Return value

Name Type Description
color Color Returns a Color ( r, g, b, a )
Example

1
2
3
4
5
6
7
Cheat.RegisterCallback("render", function()

  local col = Color(0,0,255,128)
  Renderer:DrawFilledRect(0,0,100,100,col,0.0)


end)
This will draw a blue, semi-transparent rectangle.