05.04.2023, 12:23
Hi I'm trying to get decimal R,G,B colors and convert to hex with this code
The problem is if i use big numbers then 160 function returns 0.
I think "%x" formatter doesn't format the number but couldn't solve yet
Code:
function rgbToHex(r,g,b)
rgb = (r * 0x10000) + (g * 0x100) + b
return string.format("%x", rgb)
end
The problem is if i use big numbers then 160 function returns 0.
I think "%x" formatter doesn't format the number but couldn't solve yet