Add minetest.colorspec:to_number_rgb

This commit is contained in:
Lars Mueller 2021-03-25 17:50:20 +01:00
parent d1baf23814
commit e212ba7f3b

@ -245,6 +245,10 @@ function colorspec:to_number()
return self.r * 0x1000000 + self.g * 0x10000 + self.b * 0x100 + self.a
end
function colorspec:to_number_rgb()
return self.r * 0x10000 + self.g * 0x100 + self.b
end
colorspec_to_colorstring = minetest.colorspec_to_colorstring or function(spec)
return colorspec.from_any(spec):to_string()
end