Changes

Jump to navigation Jump to search
474 bytes added ,  22:04, 26 July 2009
→‎RGBA Color: new section
Line 144: Line 144:  
</source>
 
</source>
 
:Wow-that's fantastic, thank you. --[[User:Pinecone|Pinecone]] 17:11, 20 November 2008 (UTC)
 
:Wow-that's fantastic, thank you. --[[User:Pinecone|Pinecone]] 17:11, 20 November 2008 (UTC)
 +
 +
== RGBA Color ==
 +
 +
It should be noted that there's an even easier way to convert these colors to RGBA than described on the main page.
 +
Including the alpha channel is as simple as bitshifting the colour two bytes to the left and ORing it with your alpha channel value.
 +
 +
So, for example, if we want the color RED at half opacity, then we can use:
 +
u8 alpha = 0xFF / 2;
 +
u32 color = (RED << 16) | alpha;  // 0xFF00007F
 +
-- [[User:MetaFight|MetaFight]] 20:04, 26 July 2009 (UTC)
613

edits

Navigation menu