xlunch icon indicating copy to clipboard operation
xlunch copied to clipboard

white background transparency not working

Open Botspot opened this issue 4 years ago • 6 comments

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:

  • Using a darker color like 00000050 does work as expected.
  • Interestingly, ffffff01 renders a solid white background, but ffffff00 is entirely transparent.

Botspot avatar Nov 25 '20 23:11 Botspot

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..

PMunch avatar Nov 26 '20 09:11 PMunch

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

Botspot avatar Nov 26 '20 14:11 Botspot

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.

PMunch avatar Nov 27 '20 10:11 PMunch

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.

Botspot avatar Nov 27 '20 14:11 Botspot

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

PMunch avatar May 20 '24 11:05 PMunch

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

Botspot avatar May 21 '24 16:05 Botspot