----------------------------------------------------
-- Sonic Robo Blast v2 2.2.4
-- Player skincolor to Lua color text
-- By Lucario - The Aura Pokemon
----------------------------------------------------

-- Already defined
if P_SkincolorToText return end

-- Colours 2.0
local textmap = {"\x80", "\x81", "\x82", "\x83", "\x84", "\x85", "\x86", "\x87", "\x88", "\x89", "\x8A", "\x8B", "\x8C", "\x8D", "\x8E", "\x8F"}
local colormap = {
	{SKINCOLOR_WHITE, SKINCOLOR_BONE, SKINCOLOR_AETHER}, -- White
	{SKINCOLOR_RUBY, SKINCOLOR_VAPOR, SKINCOLOR_BUBBLEGUM, SKINCOLOR_MAGENTA}, -- Magenta
	{SKINCOLOR_GOLD, SKINCOLOR_SANDY, SKINCOLOR_YELLOW, SKINCOLOR_OLIVE, SKINCOLOR_LIME}, -- Yellow
	{SKINCOLOR_MOSS, SKINCOLOR_GREEN, SKINCOLOR_FOREST, SKINCOLOR_EMERALD, SKINCOLOR_MINT}, -- Green
	{SKINCOLOR_SLATE, SKINCOLOR_AZURE, SKINCOLOR_SEAFOAM, SKINCOLOR_CERULEAN, SKINCOLOR_SAPPHIRE, SKINCOLOR_BLUE, SKINCOLOR_COBALT}, -- Blue
	{SKINCOLOR_PINK, SKINCOLOR_SALMON, SKINCOLOR_RED, SKINCOLOR_CRIMSON, SKINCOLOR_BEIGE, SKINCOLOR_LILAC}, -- Red
	{SKINCOLOR_CLOUDY, SKINCOLOR_GREY, SKINCOLOR_SILVER, SKINCOLOR_CARBON}, -- Grey
	{SKINCOLOR_YOGURT, SKINCOLOR_FLAME, SKINCOLOR_PEACHY, SKINCOLOR_QUAIL, SKINCOLOR_SUNSET, SKINCOLOR_APRICOT, SKINCOLOR_ORANGE, SKINCOLOR_RUST, SKINCOLOR_COPPER, SKINCOLOR_KETCHUP}, -- Orange
	{SKINCOLOR_WAVE, SKINCOLOR_CYAN, SKINCOLOR_SKY, SKINCOLOR_ICY}, -- Sky
	{SKINCOLOR_LAVENDER, SKINCOLOR_NEON, SKINCOLOR_VIOLET, SKINCOLOR_DUSK, SKINCOLOR_PASTEL, SKINCOLOR_PURPLE}, -- Purple
	{SKINCOLOR_AQUA, SKINCOLOR_TEAL}, -- Aqua
	{SKINCOLOR_PERIDOT, SKINCOLOR_APPLE}, -- Peridot
	{SKINCOLOR_CORNFLOWER, SKINCOLOR_BLUEBELL}, -- Azure
	{SKINCOLOR_BROWN, SKINCOLOR_TAN, SKINCOLOR_BEIGE, SKINCOLOR_PLUM, SKINCOLOR_BRONZE}, -- Brown
	{SKINCOLOR_ROSY, SKINCOLOR_RASPBERRY}, -- Rosy
	{SKINCOLOR_JET, SKINCOLOR_BLACK}, -- Inverted
}

rawset(_G, "P_SkincolorToText", function (skincolor)
	for i = 1, #colormap
		for j = 1, #colormap[i]
			if (colormap[i][j] == skincolor) return textmap[i] end
		end
	end
	return "\x80"
end)