Sets the background color.
![]() |
In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1. |
love.graphics.setBackgroundColor( red, green, blue, alpha )
number red
number green
number blue
number alpha (1)
Nothing.
function love.draw() -- Set Background Color to #731b87 (115, 27, 135) with an alpha of 50% -- Note: Remember that Love uses 0-1 and not 0-255 red = 115/255 green = 27/255 blue = 135/255 alpha = 50/100 love.graphics.setBackgroundColor( red, green, blue, alpha) end
Available since LÖVE 0.7.0 |
This variant is not supported in earlier versions. |
love.graphics.setBackgroundColor( rgb )
table rgb
Nothing.
function love.draw() -- Set Background Color to #1b8724 (27, 135, 36) -- Note: Remember that Love uses 0-1 and not 0-255 red = 27/255 green = 135/255 blue = 36/255 color = { red, green, blue} love.graphics.setBackgroundColor( color) end
Available since LÖVE 0.8.0 |
This variant is not supported in earlier versions. |
love.graphics.setBackgroundColor( rgba )
table rgba
Nothing.
function love.draw() -- Set Background Color to #731b87 (115, 27, 135) with an alpha of 50% -- Note: Remember that Love uses 0-1 and not 0-255 red = 115/255 green = 27/255 blue = 135/255 alpha = 50/100 color = { red, green, blue, alpha} love.graphics.setBackgroundColor( color) end