From 9d2b0b667b9bfb2d8b6969ade0ff0bd8d646d7d7 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 1 Aug 2013 14:52:28 +1000 Subject: Add color blending to GDISP --- include/gdisp/gdisp.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/gdisp/gdisp.h b/include/gdisp/gdisp.h index ac741d3b..ca1844fd 100644 --- a/include/gdisp/gdisp.h +++ b/include/gdisp/gdisp.h @@ -800,6 +800,19 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); void gdispFillRoundedBox(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t radius, color_t color); #endif + +/** + * @brief Blend 2 colors according to the alpha + * @return The combined color + * + * @param[in] fg The foreground color + * @param[in] bg The background color + * @param[in] alpha The alpha value (0-255). 0 is all background, 255 is all foreground. + * + * @api + */ +color_t gdispBlendColor(color_t fg, color_t bg, uint8_t alpha); + /* Support routine for packed pixel formats */ #if !defined(gdispPackPixels) || defined(__DOXYGEN__) /** -- cgit v1.2.3