RGBA To Hex
#1

I Need a function in pawn that converts RGBA to hex but i can't create one i have no idea how to do it
Reply
#2

pawn Код:
stock rgb2hex(red, green, blue) return (red << 16) | (green << 8) | blue;
Reply
#3

first of all thanx
but can u say to me how to use the hex then ??
cuz what i see returns values to each red green blue not a hex like 0xFF0000 or something
Reply
#4

printf("%x", rgb2hex(255, 0, 0));
what does it returns?
Reply
#5

A hex value is really an integer anyways but ya you can use the %x specifier to get the hex value in a string.
Reply
#6

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
A hex value is really an integer anyways but ya you can use the %x specifier to get the hex value in a string.
otherwise its returned in rrrgggbbb format, and yes - as an integer.
Reply
#7

Thanx guys i got it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)