If you're actually trying to implement a selectable color palette like the right side of the top picture, or the color wheel within your .love game, then that's a big project. If you are just needing to have a few preset selections, then you could probably make a few simply rectangles that trigger a base color change upon selection. Implement a simple class that has a rectangle and a setColor() function that would be called if you love.mousepressed() on it:
colorSwatches = {} -- Load in your color swatches
function newColorSwatch(x,y,w,h,rgba)
local a = {}
a.x = x
a.y = y
a.w = w
a.h = h
a.color = rgba
a.trigger = function()
love.graphics.setColor(a.color)
end
return a
end
local function contains2D(x, y, rect)
if rect.x < x and x < rect.x + rect.w then
if rect.y < y and y < rect.y + rect.h then
return true
end
end
return false
end
function love.mousepressed(x, y, b)
if b == "l" then
for _,v in pairs(colorSwatches) do
if contains2D(x, y, v) then
v.trigger()
end
end
end
end