emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
592 stars 56 forks source link

Screenshot: Implement PickColor method #132

Closed junglerobba closed 3 years ago

junglerobba commented 3 years ago

I couldn't find any application to test this method, so i just used the usual python script and modified it a bit: https://gist.github.com/junglerobba/e3985bc66a025aed6beb5edfee1ed900

Not sure if the whole ppm parsing is really necessary, but I felt it was safer to do so.

closes #129

danshick commented 3 years ago

Very cool, thanks!

danshick commented 3 years ago

Does this tool work to test it? This issue seems to imply it can only use the portal color picker method, which works in our advantage.

https://gitlab.gnome.org/World/gcolor3/-/issues/124

emersion commented 3 years ago

IIRC Gimp might be able to use it as well, but not sure if support is merged already.

junglerobba commented 3 years ago

https://gitlab.gnome.org/World/gcolor3/-/issues/124

Just tested with the flatpak, and it works just fine.

danshick commented 3 years ago

I also just tested it with gcolor3 without flatpak. It didn't function properly before this change and it does function correctly now, so I'm calling that a success.

Edit: and the color I picked matches a known value, so it is accurate

junglerobba commented 3 years ago

Tried to address all current feedback. I'm not sure yet if I'm quite happy with the ppm parsing code, but it seems to be working fine at least