Function
love.graphics.setColor( red, green, blue, alpha )
Sets the color used for drawing.
Synopsis
love.graphics.setColor( red, green, blue, alpha )
Parameters
red number The amount of red.
green number The amount of green.
blue number The amount of blue.
alpha = 255 number The amount of alpha.
Examples
Set draw a red circle and a blue one
  1. love.graphics.setColor(255, 0, 0)
  2. love.graphics.circle(50, 50, 20, 20)
  3. love.graphics.setColor(0, 0, 255)
  4. love.graphics.circle(50, 100, 20, 20)
Display a Venn diagram
  1. function love.load()
  2.     baseX = 300
  3.     baseY = 400
  4.     radius = 100
  5.     offsetY = radius*.5*math.sqrt(3)
  6.     love.graphics.setBackgroundColor(255,255,255)
  7. end
  8.  
  9. function love.draw()
  10.     love.graphics.setColor(255, 0, 0, 100)
  11.     love.graphics.circle('fill', baseX, baseY, radius, 50)
  12.     love.graphics.setColor(0, 255, 0, 100)
  13.     love.graphics.circle('fill', baseX + radius / 2, baseY - offsetY, radius, 50)
  14.     love.graphics.setColor(0, 0, 255, 100)
  15.     love.graphics.circle('fill', baseX + radius, baseY, radius, 50)
  16. end
Copyright © 2006-2010 LÖVE Development Team.