string.multi_color = function(array, enable_alpha)
local out_text = ''
for i, global_array in ipairs(array) do
local text = global_array[1]
local col = global_array[2] or color()
local hex_col = ''
if col ~= nil then
hex_col = enable_alpha and col:to_hex() or col:to_hex():sub(1, 6)
end
out_text = out_text .. '\a' .. hex_col .. text
end
return out_text
end
--[[
render.text(1, vector(x, y), color(), nil, string.multi_color({
{'hello ', color()},
{'world', color(255, 0)}
}, true))
]]