Read/WritePixel Rgb Conversion

BlitzMax Forums/BlitzMax Programming/Read/WritePixel Rgb Conversion

Anyone know how to convert read/writepixel rgb values to seperate r,g,b values(In the range of 0-255) and back?

Here's what I have presently. GetRGB appears to work, but genRGb is (bleep)ed up.

	Function GenRgb( red,green,blue,alpha  )
Local rgb = ((alpha & $ff) Shl 24) | ((red & $ff) Shl 16) | (( green & $ff) Shl 8) | blue & $ff
		Return rgb
		
	End Function
	
	Function GetRGB(argb:Int,a Var,r Var, g Var, b Var)
		a=(argb Shr 24) & $ff
		r=(argb Shr 16) & $ff
		g=(argb Shr 8) & $ff
		b=argb & $ff
	End Function


Does the internal format of the pixel require further pixel conversion?

Why is this not in the docs? <Insert Rant>