This is simple function that i made in 2 minutes.
Код:
stock ColorsName(color[])
{
enum eColor
{
colorName[16],
colorID[7]
};
new cInfo[][eColor] =
{
// {Color, Hex }
{ "BLUE", "1B1BE0" },
{ "PINK", "E81CC9" },
{ "YELLOW", "DBED15" },
{ "LIGHTGREEN", "8CED15" },
{ "LIGHTBLUE", "15D4ED" },
{ "RED", "FF0000" },
{ "GREY", "BABABA" },
{ "WHITE", "FFFFFF" },
{ "ORANGE", "DB881A" },
{ "GREEN", "37DB45" },
{ "PURPLE", "7340DB" }
},
tString[7];
for(new x; x != sizeof(cInfo); x++) if(!strcmp(cInfo[x][colorName], color, true))
{
format(tString, 7, "%s", cInfo[x][colorID]);
return tString;
}
return tString;
}
Simple. Like this: