Help with colors as bit values

BlitzMax Forums/BlitzMax Beginners Area/Help with colors as bit values

My question deals with passing a desired RGBA as a function for writing to a pixmap. Is there anyone willing to explain how I would enter a RGBA value? I'm not familiar with how the values are added to create the bit values desired....

According to the manual:

Function WritePixel( pixmap:TPixmap,x,y,argb ) 
Description Write a pixel to a pixmap. 
Information The 32 bit argb value contains the following components:

bits 24-31 pixel alpha 
bits 16-23 pixel red 
bits 8-15 pixel green 
bits 0-7 pixel blue 
 


This might help
Function RGBA_Red%(rgba%)
		Return (rgba Shr 16) & $FF	
	End Function
              
	Function RGBA_Green%(rgba%)
		Return (rgba Shr 8) & $FF 
	End Function
	
	Function RGBA_Blue%(rgba%)
		Return rgba & $FF 
	End Function
	
	Function RGBA_alpha%(rgba%)
		Return (rgba% Shr 24) & $FF
	End Function
	
	Function ToRGBA%(r%,g%,b%,a%)
		'return (a << 24) | (r << 16) | (g << 8) | (b);
		Return ((A Shl 24) | (R Shl 16) | (G Shl 8) | B)
	End Function