How to convert int to hex?
#1

Hi, I'm making a function in which the player can specify his own color.
I'm using three parameters, red, green and blue (all integers).
But now I want to convert these integers into a hex string, is there any function to do that?
Reply
#2

well you can just do string way:
the difficult part is only after 9:
10 = A
11 = B
12 = C
13 = D
14 = E
15 = F
i suggest you using dialog inputs for each color and than switch:
pawn Код:
switch(color)
{
case 1: clr1 = "1";
case 2: clr1 = "2";
case 14: clr1 = ''D";
}
and then combine it all
Reply
#3

Thanks!
Reply
#4

Quote:
Originally Posted by Superthijs
Посмотреть сообщение
Thanks!
well, i am not sure if that will work, but have a try...
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 51 seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)