dmenu-flexipatch icon indicating copy to clipboard operation
dmenu-flexipatch copied to clipboard

Add RGBA support

Open UtkarshVerma opened this issue 3 years ago • 6 comments

This PR removes the alphas array and implements RGBA support.

UtkarshVerma avatar Jul 09 '22 04:07 UtkarshVerma

This certainly simplifies the alpha patch a great deal. Will have to do a more in-depth review given that what is here is not what you'd get with the normal alpha patch.

There may be a few edge cases to consider like when using short RGB codes like #ccc or named colours like "magenta".

bakkeby avatar Jul 09 '22 07:07 bakkeby

My personal opinion on the short names is that they should be deemed invalid. This PR behaves in the following way, currently:

  • If passed #RRGGBB, consider alpha = 255
  • If passed #RRGGBBAA, parse the alpha hex
  • Panic otherwise

This keeps the code-base simple and clear.

UtkarshVerma avatar Jul 09 '22 08:07 UtkarshVerma

My personal opinion on the short names is that they should be deemed invalid. This PR behaves in the following way, currently:

* If passed #RRGGBB, consider alpha = 255

* If passed #RRGGBBAA, parse the alpha hex

* Panic otherwise

This keeps the code-base simple and clear.

Have you considered the fact that this also break literal color names such as "white"/"black" etc ? Because colornames aren't limited to hex values as of now.

P.S: Just noticed that bakkeby already bought up the issue with named colors.

N-R-K avatar Aug 25 '22 15:08 N-R-K

For this patch to be feasible, what improvements do you guys think I should make?

UtkarshVerma avatar Feb 16 '23 05:02 UtkarshVerma

Maybe this is better as a candidate patch on the suckless pages page?

I did play around with something similar for dwm and my experience with it is that although it works it is kind of annoying to maintain alpha values on a per individual colour code basis, especially when you are using Xresources.

bakkeby avatar Feb 16 '23 09:02 bakkeby

Maybe this is better as a candidate patch on the suckless pages page?

I did play around with something similar for dwm and my experience with it is that although it works it is kind of annoying to maintain alpha values on a per individual colour code basis, especially when you are using Xresources.

I don't feel it is annoying at all. I simply rely on pywal for applying my config everywhere. Even then, the config isn't big: image

For me, the biggest issue was not being able to modify the alpha value at all, and this patch serves my use case. I'll try putting this up on the suckless website once I find time.

UtkarshVerma avatar Feb 19 '23 06:02 UtkarshVerma