Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RGBA support #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add RGBA support #13

wants to merge 4 commits into from

Conversation

UtkarshVerma
Copy link

This PR removes the alphas array and implements RGBA support.

@bakkeby
Copy link
Owner

bakkeby commented Jul 9, 2022

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

@UtkarshVerma
Copy link
Author

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.

drw.c Outdated Show resolved Hide resolved
@N-R-K
Copy link

N-R-K commented Aug 25, 2022

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.

@UtkarshVerma
Copy link
Author

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

@bakkeby
Copy link
Owner

bakkeby commented Feb 16, 2023

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.

@UtkarshVerma
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants