Using alpha blending #827
Replies: 2 comments
-
|
Hi,
does this work? gdraw.setColorDepth(32);
gdraw.fillSprite((lgfx::argb8888)0xFF00FFFFu); // fill argb(cyan 100% opaque)
gdraw.fillRectAlpha( 0, 0, gdraw.width(), gdraw.height(), 150, (lgfx::rgb888)0x0000FFu ); // blend 0x96 opacity with rgb(blue)Otherwise you should be able to use lgfx::argb8888 bg = 0xFF0000FFu // blue opaque (background)
lgfx::argb8888 fg = 0x9600FFFFu; // cyan semi transparent (to blend)
gdraw.setColorDepth(32);
gdraw.fillSprite(bg);
graw.fillRect(10, 10, 100, 100, fg); // should blend with backgroundNon-alpha blending can happen with other color depths when invoking And if you have an esp32p4, just use ppa_blend. |
Beta Was this translation helpful? Give feedback.
-
I had to change gdraw.setColorDepth(32);
gdraw.fillSprite((lgfx::argb8888_t)0xFF00FFFFu); // fill argb(cyan 100% opaque)
gdraw.fillRectAlpha( 0, 0, gdraw.width(), gdraw.height(), 150, (lgfx::argb8888_t)0x0000FFu ); // blend 0x96 opacity with rgb(blue)But even then, I can't see anything on the screen. #include <LovyanGFX.h>
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
LGFX tft;
LGFX_Sprite gdraw(&tft);
tft.init();
tft.setSwapBytes(true);
gdraw.setPsram(true);
gdraw.setColorDepth(lgfx::rgb332_1Byte);
gdraw.createSprite(480, 480);
gdraw.fillSprite (TFT_BLACK);
gdraw.pushSprite (0, 0);A color image is obtained only with Maybe my |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Good day @tobozo 😀
The
TFT_eSPIlibrary has a color mixing functionThe
LovyanGFXlibrary has such a functionIs there any way to use a similar color mix?
Beta Was this translation helpful? Give feedback.
All reactions