Github
While RGB is good and has its uses, it isn't very good at giving you a lot of control over colors. This is where vivid comes in, it gives you the chance to use 6 other color spaces instead of RGB. It provides functions to convert to and from these colorspaces, as well as wrapper functions to magically do it for you. For example, want to do love.graphics.setColor, but with HSL?
Code: Select all
setHSL = vivid.wrapHSL(love.graphics.setColor)
setHSL(0.3,0.5,0.5)
Code: Select all
r,g,b = vivid.lighten(0.1,10,20,10) -- Lightens by 0.1 using the HSL colorspace
Code: Select all
playerColors = vivid.HSLSpread(4, math.random(), 0.3, 0.5) -- 4 colors, random hue offset, 0.3 saturation, 0.5 lightness