Sets the color used for drawing.
love.graphics.setColor( red, green, blue, alpha )
number red
number green
number blue
number alpha (255)
Nothing.
Available since LÖVE 0.7.0
This variant is not supported in earlier versions.
love.graphics.setColor( rgba )
table rgba
Nothing.
love.graphics.setColor(255, 0, 0) love.graphics.circle(50, 50, 20, 20) love.graphics.setColor(0, 0, 255) love.graphics.circle(50, 100, 20, 20) myColor = {0, 255, 0, 255} love.graphics.setColor(myColor) love.graphics.circle(50, 150, 20, 20)
function love.load() baseX = 300 baseY = 400 radius = 100 offsetY = radius*.5*math.sqrt(3) love.graphics.setBackgroundColor(255,255,255) end function love.draw() love.graphics.setColor(255, 0, 0, 100) love.graphics.circle('fill', baseX, baseY, radius, 50) love.graphics.setColor(0, 255, 0, 100) love.graphics.circle('fill', baseX + radius / 2, baseY - offsetY, radius, 50) love.graphics.setColor(0, 0, 255, 100) love.graphics.circle('fill', baseX + radius, baseY, radius, 50) end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.setColor