26.05.2015, 23:01
Hey,
I need to convert this hex code:
to:
And please, do not give me these kind of functions:
I tried these all, never succeed converting it.
Thanks in advance, Ran
I need to convert this hex code:
Код:
#RRGGBBAA
Код:
0xAARRGGBBB
Код:
stock HexToInt(string[]) // By DracoBlue { if (string[0]==0) return 0; new i; new cur=1; new res=0; for (i=strlen(string);i>0;i--) { if (string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10); cur=cur*16; } return res; } stock HexToRGBA(colour, &r, &g, &b, &a) //By Betamaster { r = (colour >> 24) & 0xFF; g = (colour >> 16) & 0xFF; b = (colour >> 8) & 0xFF; a = colour & 0xFF; } stock RGBA2ARGB(rgba) { new src[4]; for(new j = 0; j < 4; j++) src[j] = (!(24-(8*j)) ? rgba : (rgba >> (24-(8*j)))) & 0x000000FF; return (src[3] * 16777216) + (src[0] * 65536) + (src[1] * 256) + src[2]; } stock RGBAToARGB( rgba ) return rgba >>> 8 | rgba << 24;
Thanks in advance, Ran