Setting the Project Color Mode

Last modified by Microchip on 2025/01/09 10:07

Introduction

Color Mode refers to the way colors are represented and managed in display systems, particularly in microcontroller-based applications that involve Graphical User Interfaces (GUIs) or displays. In Microchip Graphics Suite (MGS) Harmony, the project Color Mode determines the number of bits used for each pixel (bpp or bits-per-pixel) and the range of colors available in the GUI.

The higher the bit-depth, the more colors can be represented, resulting in more detailed and accurate color representation. However, higher bit-depth requires more memory and processing power to render. Selecting the appropriate Color Mode for your UI design and target hardware helps optimize the GUI for performance and memory consumption.

Supported Color Modes

MGS Harmony supports the following color modes:

Color ModeBits-per-pixelDescription
MONO1 bitMonochrome
GS_88 bitsGrayscale
RGB_3328 bits3 bits RED, 3 bits GREEN, 2 bits BLUE
RGB_56516 bits5 bits RED, 6 bits GREEN, 5 bits BLUE
RGB_555116 bits5 bits RED, 5 bits GREEN, 5 bits BLUE, 1 bit ALPHA
RGB_88824 bits8 bits RED, 8 bits GREEN, 8 bits BLUE
RGBA_888832 bits8 bits RED, 8 bits GREEN, 8 bits BLUE, 8 bits ALPHA
ARGB_888832 bits8 bits ALPHA, 8 bits RED, 8 bits GREEN, 8 bits BLUE

Setting the Color Mode

For New Projects

The default Color Mode is selected when creating a new project in MGS Composer. This is the color mode used for new layers created in the design.

New Project Color Mode

Figure 1: New Project Color Mode

Back to Top

For Existing Projects

To change the Default Color Mode of existing MGS Composer projects, go to Project > Project Settings > Renderer > Default Color Mode.

Renderer Color Mode settings

Figure 2: Renderer Color Mode 

Warning

The new Default Color Mode will only be used on new layers or screens. It doesn't change the color mode of existing layers. Each existing layer must be set to use the new color mode.

To set the layer color mode, select each layer in the design and set the Color Mode property to the new color mode.

Layer Color mode

Figure 3: Layer Color Mode

Note that MGS Composer allows different color modes for each layer. This is not commonly used and is mainly reserved for use in configurations where absolutely needed (e.g., memory or bandwidth constraints in multi-layer designs).

Back to Top

Image Assets Color Mode

The color mode for image assets is independent of the project color mode.

If the image asset color mode is different from the color mode of the layer where the image is being rendered, the graphics library will convert the image color to match the project color mode before rendering. This color conversion step adds processing overhead and may reduce performance.

As a general guideline, we recommend that the image color mode be set to match the project color mode. Refer to the "Using Images in Microchip Graphics Suite (MGS)" page for more information.

Back to Top

Color Schemes Color Mode

The color mode setting for color schemes is independent of the project color mode. MGS Composer generates a table of colors for each supported color mode so the values are the same regardless of the project color mode.

The color mode setting sets the way the color values are set and presented in the Color Scheme editor window, and it does not need to be changed when changing project color modes.

Back to Top

Display Driver Color Mode

Information

The display controller color mode must be set to match the project color mode. Otherwise, the UI will not display correctly on the screen, resulting in distorted, stretched, or compressed images on the screen. For multi-layer designs, each display controller layer (overlay) must have the same color mode as the corresponding layer in MGS Composer.

The display controller color mode is separately configured through the display driver. For MGS Harmony, the display controller color mode must be set in the display driver component in MCC Harmony for the target platform. 

LCDC Layer Color Mode

Figure 4: LCDC Layer Color Mode

Back to Top