[REP++] Color problem - Converting HEX
#5

Change to
pawn Код:
stock ConvertToARGB(const gColor[], bool:ARGB = true, alpha = 0xFF)
{
    new color[11],color_int;
    color = "0x";
    strcat(color, gColor);
    sscanf(color, "x", color_int);
    color_int = (color_int * 256) + alpha;
    return ARGB ? RGBAtoARGB(color_int) : color_int;
}
if you want RGBA instead of ARGB set in function bool:ARGB to false

pawn Код:
format(string,sizeof(string),"COLOR: %i",ConvertToARGB(MafiaInfo[i][turfColor], false));
Reply


Messages In This Thread
[REP++] Color problem - Converting HEX - by buburuzu19 - 15.08.2015, 11:50
Re: [REP++] Color problem - Converting HEX - by buburuzu19 - 15.08.2015, 14:20
Re: [REP++] Color problem - Converting HEX - by Vince - 15.08.2015, 14:25
Re: [REP++] Color problem - Converting HEX - by buburuzu19 - 15.08.2015, 14:57
Re: [REP++] Color problem - Converting HEX - by Jefff - 15.08.2015, 16:42
Re: [REP++] Color problem - Converting HEX - by Vince - 15.08.2015, 17:56

Forum Jump:


Users browsing this thread: 1 Guest(s)