francma / wob

A lightweight overlay volume/backlight/progress/anything bar for Wayland.
ISC License
896 stars 49 forks source link

Coloring interpretes alpha value in an unexpected way #39

Closed Zocker1999NET closed 4 years ago

Zocker1999NET commented 4 years ago

System: Debian GNU/Linux testing/unstable Sway Version: 1.4 (from Debian repository) wob Version: 7d03efc1f1bbbd165cab7d2220381042c13b1c85 (compiled from this repository)

I tried to integrate the coloring of wob into my overall theme and saw that the same color codes (swaybar's #rrggbbaa rewritten to wob's #aarrggbb format) were rendered differently, but only if the alpha value was lower than ff. More testing shows that only the "black part" of the color will be made transparent.

An example: The "colors" #00000000 and #00ffffff (#aarrggbb) should both be transparent in the same way because both have an alpha value of 00. However wob renders the first one fully transparent (as expected), but the second one fully white (not as expected). To test this yourself, run following commands:

# cd into the build directory of the repository
# Correct transparent rendering
echo 50 | ./wob -t 3000 --border-color '#00000000' --bar-color '#ff00ff00' --background-color '#00000000'
# Incorrent transparent rendering
echo 50 | ./wob -t 3000 --border-color '#00000000' --bar-color '#ff00ff00' --background-color '#00ffffff'