HEX Conversion.
#1

Is there a function that converts HEX to RGB ? The new color codes we use in messages. ?

Like HEXtoRGB( ... )
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
What do you mean by hex? Hex is a numeric representation of numbers, so if you do:

pawn Код:
#define COLOR 0xFF0033AA
You can do:

pawn Код:
format(str, sizeof (str), "{%06x}text", COLOR>>>8);
That will correctly format the colors in a string from a number. Or do you have a string representation of colour?
What i want is to convert player's color into the new code format. { }

BTW, nice usage :O
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
In that case the code I already posted will do:

pawn Код:
format(str, sizeof (str), "{%06x}text", GetPlayerColor(playerid) >>> 8);
The "06" in the x specifier may not be required. It isn't in RC1 as short colour codes are valid ({FF} is blue), but I know long codes ({FFAA4455}) are invalid in RC3, I've not yet had a chance to retest short codes.
Wow, thank you very much ******, you are a savior!
Reply
#4

[necrothread]I <3 Search Button[/necrothread]
Reply
#5

Quote:
Originally Posted by Pghpunkid
Посмотреть сообщение
[necrothread]I <3 Search Button[/necrothread]
Seriously, why did you just bump a 1 year old topic?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)