fix: proper modulo for color selection

This commit is contained in:
əlemi 2024-08-17 04:58:19 +02:00
parent 011d78b0ea
commit 174f479617
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -11,7 +11,7 @@ local available_colors = { -- TODO these are definitely not portable!
}
local function color(x)
return available_colors[ (native.hash(x) % #available_colors) + 1 ]
return available_colors[ math.fmod(math.abs(native.hash(x)), #available_colors) + 1 ]
end
local function order_tuples(x) -- TODO send help...