Round numbers to avoid eventual float in string.format

This commit is contained in:
Athozus 2023-11-05 17:04:29 +01:00
parent 0b3497eb2f
commit 4240f4eb39
No known key found for this signature in database
GPG key ID: B50895022E8484BF

View file

@ -32,9 +32,9 @@ local function rgbColorsMix(colors)
G = G + c.g
B = B + c.b
end
R = R / #colors
G = G / #colors
B = B / #colors
R = math.floor(R / #colors + 0.5)
G = math.floor(G / #colors + 0.5)
B = math.floor(B / #colors + 0.5)
return {r=R,g=G,b=B}
end