RGBConvert Macro

Microchip Graphics Library

Microchip Graphics Library
RGBConvert Macro
C
#define RGBConvert(red, green, blue) (GFX_COLOR) (((GFX_COLOR)(red) << 16) | ((GFX_COLOR)(green) << 8) | (GFX_COLOR)(blue))
Overview

This macro converts the color data to the selected COLOR_DEPTH. This macro is only valid when COLOR_DEPTH is 8, 16, or 24. 

 

Conversion 
8-8-8 to 3-3-2 conversion 
16 
8-8-8 to to 5-6-5 conversion 
24 
8-8-8 to 8-8-8 conversion or no conversion 
Input Parameters
Input Parameters 
Description 
red 
red component of the color. 
green 
green component of the color. 
blue 
blue component of the color. 
Returns

none

Preconditions

none

Side Effects

none

Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved