TouchGFX + 0/4 examples
CodeScope will show references to touchgfx::Color from the following samples and libraries:
Examples
STM32469I-Discovery
Demonstrations
STM32469I_EVAL
Demonstrations
STM324x9I_EVAL
Demonstrations
STM32F429I-Discovery
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::Color class

@class Color Color.hpp touchgfx/Color.hpp Contains functionality for color conversion. Contains functionality for color conversion.

Syntax

class Color { public:     static colortype getColorFrom24BitRGB(uint8_t red, uint8_t green, uint8_t blue);     static inline uint8_t getRedColor(colortype color)     {         uint8_t bitDepth = HAL::lcd().bitDepth();         return bitDepth == 16 ? ((color & 0xF800) >> 8) : bitDepth == 24 ? ((color.getColor32() >> 16) & 0xFF) : bitDepth == 4 ? ((color & 0xF) * 0x11) : bitDepth == 2 ? ((color & 0x3) * 0x55) : 0;     }     static inline uint8_t getGreenColor(colortype color)     {         uint8_t bitDepth = HAL::lcd().bitDepth();         return bitDepth == 16 ? ((color & 0x07E0) >> 3) : bitDepth == 24 ? ((color.getColor32() >> 8) & 0xFF) : bitDepth == 4 ? ((color & 0xF) * 0x11) : bitDepth == 2 ? ((color & 0x3) * 0x55) : 0;     }     static inline uint8_t getBlueColor(colortype color)     {         uint8_t bitDepth = HAL::lcd().bitDepth();         return bitDepth == 16 ? ((color & 0x001F) << 3) : bitDepth == 24 ? (color.getColor32() & 0xFF) : bitDepth == 4 ? ((color & 0xF) * 0x11) : bitDepth == 2 ? ((color & 0x3) * 0x55) : 0;     } };

Methods

getGreenColor()

@fn static inline uint8_t Color::getGreenColor(colortype color) Gets the green color part of a color. Gets the green color part of a color. As this function must work for all color depths, it can be somewhat slow if used in speed critical sections. Consider finding the color in another way, if possible. Read more...

getBlueColor()

@fn static inline uint8_t Color::getBlueColor(colortype color) Gets the blue color part of a color. Gets the blue color part of a color. As this function must work for all color depths, it can be somewhat slow if used in speed critical sections. Consider finding the color in another way, if possible. Read more...

getColorFrom24BitRGB()

@fn static colortype Color::getColorFrom24BitRGB(uint8_t red, uint8_t green, uint8_t blue); Generates a color representation to be used on the LCD, based on 24 bit RGB values. Depending on your chosen color bit depth, the color will be interpreted internally as either a 16 bit or 24 bit color value. Generates a color representation to be used on the LCD, based on 24 bit RGB values. Depending on your chosen color bit depth, the color will be interpreted internally as either a 16 bit or 24 bit color value. This function can be safely used regardless of whether your application is configured for 16 or 24 bit colors. Read more...

getRedColor()

@fn static inline uint8_t Color::getRedColor(colortype color) Gets the red color part of a color. Gets the red color part of a color. As this function must work for all color depths, it can be somewhat slow if used in speed critical sections. Consider finding the color in another way, if possible. Read more...

Examples

touchgfx::Color is referenced by 4 libraries and example projects.

References

LocationText
Color.hpp:32
class Color