@code
+ #include "drivers/displays/tft/drawing.h"
#include "drivers/displays/tft/colors.h"
uint16_t newColor;
uint16_t bg = COLOR_GREEN;
uint16_t fore = COLOR_WHITE;
- // Calculate the intermediate color with 25% fading
+ // Calculate the intermediate color with 25% bg blending
uint16_t result = colorsAlphaBlend(bg, fore, 25);
drawRectangleFilled(10, 10, 50, 50, bg);
// Short cut if the color is full intensity
if (fadePercent == 100)
- return foreColor;
+ return bgColor;
// Note: This algorithm can definately be optimised!