rgb to message hex code
#1

hey, how could I convert i.e 255 10 38 to hex code for SendClientMessage? The {rrggbb} code?
Reply
#2

pawn Код:
new
    color[9],
    red = 255,
    green = 10,
    blue = 38;

format(color, sizeof(color), "{%02x%02x%02x}", red, green, blue);
That would probably work.

Edit: Otherwise, if you want the actual value, you can use this:

pawn Код:
new
    red = 255,
    green = 10,
    blue = 38;

new color = red << 24 | green << 16 | blue << 8 | 0xFF;
Reply
#3

yeah,that will work,forgot such thing even existed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)