Hex to color string
#1

is there any way to do this?
something like
Code:
#define COLOR_RED 0xFF0000FF

new string[10];
new aString[100];

..(don't know how to do this)..

format(aString, 100, "{%s} This is red and {FFFFFF}this is white", string);
//aString has to be now {FF0000} This is red and {FFFFFF}this is white
// making the text red and white
Any way to do this? thanks
Reply
#2

Yes it works

pawn Code:
#define COLOR_RED FF0000
#define COLOR_GREEN 00FF00
new string[60];

format(string,50,"{%s} Red {%s} Green",COLOR_RED,COLOR_GREEN);
It will not work with your color e.g. 0xFF0000FF.

You dont need that 0x and alpha(The FF in end) in text and dialog colors.
Reply
#3

Isn't this easier?


https://sampforum.blast.hk/showthread.php?tid=196360
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)