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

fix: parse rgba correctly #81

Merged
merged 3 commits into from
Jul 25, 2021
Merged

fix: parse rgba correctly #81

merged 3 commits into from
Jul 25, 2021

Conversation

boredland
Copy link
Contributor

apparently I did not test this properly and introduced an error parsing the rgba value while cherry-picking

@boredland
Copy link
Contributor Author

hm.. i think its still not working 100% as it should:

wob --border-color "#16a085FF" --bar-color "#16a085FF" --background-color '#000000FF'

renders the wob black on black for me, while everything works nicely with red:

wob --border-color "#FF0000FF" --bar-color "#FF0000FF" --background-color '#000000FF'

@boredland
Copy link
Contributor Author

added a test with printing the values and it confirms my comment from earlier. while the red value is saved correctly, the green-ish value is just black. any ideas as to why @francma ?

@francma
Copy link
Owner

francma commented Jul 25, 2021

Looks like I've broken it in 6b1db6c#diff-8d4a2f7af9d0296ddf4f7d8c6af88631fe880014944ec713512585530ee1f853R10.

It should look like this to have correct operator precedence.

	uint8_t alpha = (uint8_t) (color.a * UINT8_MAX);
	uint8_t red = (uint8_t) (color.r * UINT8_MAX);
	uint8_t green = (uint8_t) (color.g * UINT8_MAX);
	uint8_t blue = (uint8_t) (color.b * UINT8_MAX);

Can you please make this change as part of this PR?

@boredland boredland force-pushed the master branch 2 times, most recently from 56fc3c3 to bcdba72 Compare July 25, 2021 12:26
@boredland
Copy link
Contributor Author

boredland commented Jul 25, 2021

have you got an idea why the clang-format test fails?
when I run clang-format *.c tests/*.c --output-replacements-xml | (! grep "</replacement>" 1>/dev/null) locally, it exits with 0

@francma
Copy link
Owner

francma commented Jul 25, 2021

Probably clang version mismatch - pipeline has clang 10 vs clang 11 on our local machines. I've updated pipeline to clang 11 so it will hopefully work after rebase from master.

@boredland
Copy link
Contributor Author

ya, worked! tyvm!

@francma francma merged commit 710ac17 into francma:master Jul 25, 2021
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