Posts: 734
Threads: 8
Joined: Jun 2009
Quote:
Originally Posted by Slice
Or this:
pawn Code:
stock RGBAToARGB(rgba) return rgba >>> 8 | rgba << 24;
|
At first I also made something very similiar to that function, however I noticed that with the new SA-MP 0.3 RC7-2 functions it doesn't work very well when it comes to convert a color which has alpha channels in it.
So I made this function instead and it works very well:
pawn Code:
RGBAtoARGB( rgba )
{
return
((rgba & 0xFF) << 24) | /* move A up */
((rgba >> 8) & 0xFFFFFF); /* move RGB channels down */
}