Tomas-M / xlunch

Graphical app launcher for X with minimal dependencies
http://xlunch.org
GNU General Public License v3.0
219 stars 37 forks source link

white background transparency not working #117

Open Botspot opened 3 years ago

Botspot commented 3 years ago

I'm using this command:

xlunch --bc ffffff50

Expected behavior:

white background is noticeably transparent.

Actual behavior:

White background is completely opaque, but the icons are mostly transparent.

Notes:

PMunch commented 3 years ago

This is an issue with how transparency is handled by either your compositor, x11, or by the imlib library (can't remember which). I've seen the same thing and unfortunately haven't found a way to fix it. Essentially transparent colour mixing is some kind of weird additive or multiplicative blending which means white behaves weirdly..

Botspot commented 3 years ago

I'm using xcompmgr right now. Do you have a suggestion for an alternative compositor?

PMunch commented 3 years ago

Not really, I haven't gotten it to work myself. I think it might be an imlib thing.. I guess I should have another look at this and see if I can find a solution.

Botspot commented 3 years ago

I guess I should have another look at this and see if I can find a solution.

Yes, please. It would look sooo cool if the window could be a transparent white window.

PMunch commented 3 months ago

Not sure if you're still looking for this or not, but the trick I've figured out is to pre-multiply the alpha. So If you want white ffffff at 50% transparency that would be 0xff / 2 = 0x7f so the colour to set would be 7f7f7f7f. Or if you'd want the orange ff7f00 at 50% transparency that would be 7f3f007f.

Hopefully this is useful to you or someone else! However I guess xlunch should ideally do this pre-multiplication for you

Botspot commented 3 months ago

Not sure if you're still looking for this or not, but the trick I've figured out is to pre-multiply the alpha. So If you want white ffffff at 50% transparency that would be 0xff / 2 = 0x7f so the colour to set would be 7f7f7f7f.

I tried that today and there is an issue with that: 7f7f7f7f is more of a grey color than white. The transparent "white" color has a darkening effect on white elements behind the window. Refer to the screenshot. 20240521_11h06m05s_grim