mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
Add minetest.rgba function that returns ColorString from RGBA or RGB values
This commit is contained in:
parent
1425c6def1
commit
bc53c82bcf
3 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue