SuperiorServers/dash

function COLOR:SetHex(hex)

Opened this issue · 2 comments

How must work this shit?

I doesn't find other way like recode this shit like

function COLOR:SetHex(hex)
	local r, g, b = string_match(hex, '#(..)(..)(..)')
	self.r, self.g, self.b = tonumber(r, 16), tonumber(g, 16), tonumber(b, 16)
	return Color(self.r, self.g, self.b)
end

instead

function COLOR:SetHex(hex)
	local r, g, b = string_match(hex, '#(..)(..)(..)')
	self.r, self.g, self.b = tonumber(r, 16), tonumber(g, 16), tonumber(b, 16)
end

How must work this shit?

local myHexColor = Color(255, 53, 30):ToHex()
local myNormalColor = Color()
myNormalColor:SetHex(myHexColor)

Example of the usage, easiest way to save the color table in MySQL.

EncodedRGB/A would actually be the best method for storing in a database