Convert color to string and opposite
#4

If you understood a Hex you'd know that there's 4 values:

pawn Код:
0xRRGGBBAA
Red, Green, Blue, Alpha

What you should do is use sscanf:

pawn Код:
if(!sscanf(params, "ddd", r, g, b))
And you then have the values that the user imputted, for example:

Код:
/chatcolour 0 30 255
Then use the function (somewhere on the forums) RGBAToHex, which should convert it into Hex.

Then save the Hex to a file.
Reply


Messages In This Thread
Convert color to string and opposite - by ikey07 - 19.07.2010, 10:07
Re: Convert color to string and opposite - by Mystique - 19.07.2010, 10:41
Re: Convert color to string and opposite - by ikey07 - 19.07.2010, 10:53
Re: Convert color to string and opposite - by Joe_ - 19.07.2010, 11:40
Re: Convert color to string and opposite - by ikey07 - 19.07.2010, 12:07
Re: Convert color to string and opposite - by Finn - 19.07.2010, 12:40
Re: Convert color to string and opposite - by ikey07 - 19.07.2010, 15:57

Forum Jump:


Users browsing this thread: 6 Guest(s)