agraef / pd-lua

Lua bindings for Pd, updated for Lua 5.3+
https://agraef.github.io/pd-lua/
GNU General Public License v2.0
47 stars 10 forks source link

Fix alpha colour support in plugdata #50

Closed timothyschoen closed 4 weeks ago

timothyschoen commented 4 weeks ago

I think this should be possible in purr-data too? I added this, since there is basically no other way to do transparency in Pd.

agraef commented 4 weeks ago

Ah, I already wondered why I couldn't get transparency in plugdata to work. Not sure whether Tk supports alpha blending nowadays, but even if it does, vanilla Pd probably doesn't.

I think this should be possible in purr-data too?

Sure is, the GUI is basically Chromium after all:

purr-data-alpha

Note that both the comment text and the canvas rectangle are actually behind the dial. All parts of the pdlua object (except the border of the dial's face) have various degrees of transparency.

The required changes in pdlua_gfx.h and pdlua.c are minimal. I'm ready to commit them along with your PR.

agraef commented 4 weeks ago

Merged, thanks!

agraef commented 4 weeks ago

BTW, what's up with those palette colors 0, 1, 2? They seem to be different between plugdata and vanilla where both 0 and 2 are white, and 1 is black. Is 2 supposed to be an alternative background color? Should any of these have transparency in plugdata or purr-data?