Color to hex
#1

how I can convert this color 0xC2A2DAFF to hex
like {FFFFFF}
Reply
#2

{C2A2DA}
Reply
#3

pawn Код:
stock RGBAToHex(r, g, b, a) //By Betamaster
{
    return (r<<24 | g<<16 | b<<8 | a);
}

stock HexToRGBA(colour, &r, &g, &b, &a) //By Betamaster
{
    r = (colour >> 24) & 0xFF;
    g = (colour >> 16) & 0xFF;
    b = (colour >> 8) & 0xFF;
    a = colour & 0xFF;
}
or

This one.
Reply
#4

Quote:

how I can convert this color 0xC2A2DAFF to hex
like {FFFFFF}

If you wanna do it yourself then take the number between the 0x and the FF(or whatever is the last symbol)

Example:
0xC2A2DAFF --> 0xC2A2DAFF --> {C2A2DA}
Reply
#5

thank you all guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)