Code archives/Graphics/GetRGB

This code has not been declared by its author to be Public Domain code, and therefore should not be assumed to be so.

Download source code

GetRGB by Skully
(Posted 25 years ago)
Returns an RGB colour code for the red/green/blue components and back again
Function GetRed(rgb) 
	Return rgb Shr 16 And %11111111 
End Function 

Function GetGreen(rgb) 
	Return rgb Shr 8 And %11111111 
End Function 

Function GetBlue(rgb) 
	Return rgb And %11111111 
End Function

Function GetRGB(red,green,blue)
	Return blue Or (green Shl 8) Or (red Shl 16)
End Function

Comments

None.

Code Archives Forum