You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionlove.load()
lue:setColor("my-color", {255, 255, 255})
end
Update lue
functionlove.update(dt)
lue:update(dt)
end
Get color
functionlove.draw()
love.graphics.setColor( lue:getColor("my-color") )
end
Color objects
You might also declare color objects instead of calling lue:setColor("colorname", color)
For instance,
functionlove.load()
myColor=lue:newColor():setColor({255, 255, 255}) --methods can be chainedendfunctionlove.update(dt)
myColor:update(dt)
endfunctionlove.draw()
love.graphics.setColor( myColor:getColor() )
end
Methods
Update lue
lue:update(dt)
Set color
lue:setColor("name", {colorTable}) --basiclue:setColor("name", {
color=colorTable,
--[[ or ]]--hue=hueTable-- {saturation, lightness, opacity, offset}speed=number, --if provided, color with transition smoothly
})
--the same goes for myColor:setColor(...), just remove the "name" argument
Get color - if target == true, then the function will return the target color instead of the current color