Add minetest.rgba function that returns ColorString from RGBA or RGB values

This commit is contained in:
Gael-de-Sailly 2015-02-27 20:51:55 +01:00 committed by Nils Dagsson Moskopp
parent a9f5dcf7c7
commit dd12312b58
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 6 additions and 0 deletions

View File

@ -511,6 +511,12 @@ function core.explode_scrollbar_event(evt)
return retval
end
--------------------------------------------------------------------------------
function core.rgba(r, g, b, a)
return a and string.format("#%02X%02X%02X%02X", r, g, b, a) or
string.format("#%02X%02X%02X", r, g, b)
end
--------------------------------------------------------------------------------
function core.pos_to_string(pos, decimal_places)
local x = pos.x