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 set_alpha filter #95

Merged
merged 5 commits into from
Aug 12, 2024
Merged

Add set_alpha filter #95

merged 5 commits into from
Aug 12, 2024

Conversation

Davenchy
Copy link
Contributor

@Davenchy Davenchy commented Jul 26, 2024

Hello,

I hope you are doing well.

I added a set_alpha filter. Additionally, I implemented two new functions, format_rgba_float and format_hsla_float, to address the alpha channel value formatting. The original functions print the alpha value in the range 0 to 255, while it should be in the range 0.0 to 1.0.

I also updated the example/colors.whatever-extension file with a simple usage example of the set_alpha filter and made an entry in the changelog under the "unreleased" section to document this addition.

I noticed that the current implementation represents the alpha channel value in the range 0 to 255. As per my understanding, it should be in the range 0.0 to 1.0. I did not remove any existing code but added the filter implementation and the two methods to correct the output of the filter.

I suggest reconsidering the current implementation of the alpha channel value. I am ready to contribute further.

@Davenchy
Copy link
Contributor Author

Here is a real example demonstrating the need for the set_alpha filter.

In my swaync CSS file, I used the set_alpha filter to set the background of the notification center to 0.7, as shown in the screenshot.

image

@InioX
Copy link
Owner

InioX commented Aug 12, 2024

Thanks! I will fix the alpha value to be a float.

@InioX InioX merged commit e28048c into InioX:main Aug 12, 2024
@InioX InioX mentioned this pull request Aug 12, 2024
@Davenchy Davenchy deleted the set_alpha_filter_feature branch August 12, 2024 06:59
InioX added a commit that referenced this pull request Aug 13, 2024
InioX added a commit that referenced this pull request Aug 13, 2024
@InioX InioX mentioned this pull request Aug 13, 2024
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.

2 participants