superhighfives / pika

An open-source colour picker app for macOS
https://superhighfives.com/pika
MIT License
1.72k stars 56 forks source link

Pika's drop-shadow affects the sampling #29

Closed lloydi closed 3 years ago

lloydi commented 3 years ago

When you place Pika close to the area that you are sampling, the window's drop-shadow adds to the underlying area's luminosity, potentially causing an incorrect reading

To Reproduce With Pika running, place over an area known to have a white background Sample the background colour just below the bottom of Pika's window

Expected behavior The colour of the area undeath should be correctly identified as #ffffff, but will be darker than that as it icludes whatever window drop-shadow shade is over the top

Environment (please complete the following information):

Additional context This may be an OS-level thing that cannot be avoided (short of moving the Pika app further away from where you are sampling). Can the drop-shadow effect be removed for just this app?

superhighfives commented 3 years ago

Hey @lloydi—you raise a good point. One option would be to make the shadow smaller, but within macOS the only option is to turn it off entirely, which visually makes Pika really difficult to distinguish from the background (and breaks the expected visual window layering of the OS). From what I can find there are hacky ways to get around it, using private APIs, but I'd prefer not to go that route.

I really want Pika to be a great color picker, but to also be a really beautiful app in and of itself, and I feel like turning the shadow off entirely would make it too stark.

You can see an example here: image

Actually, one other thought is that Pika could hide itself while you're picking a color. You can see a video of this behaviour here—keen to get people's feedback: https://user-images.githubusercontent.com/449385/106212467-9d90e300-61c2-11eb-8b6a-271a71d25e3f.mov

I also made a branch and a PR if anyone is keen to check it out locally: https://github.com/superhighfives/pika/tree/remove-shadow-from-pika

lloydi commented 3 years ago

I get that removing the drop-shadow will make it less visually appealing. The drop-shadow helps to see the app against the background. Interesting idea to remove the app while picking, but how about this as a solution:

Don't hide the app Leave the drop-shadow BUT ...

When using the color picker, at the point that the click event occurs, hide the app for a milisecond or however short a time as you can (which should also remove the shadow), take the reading then show the app again. My thinking is that the duration of the hide should be imperceptible, but still give you an accurate reading. Is that plausible?

superhighfives commented 3 years ago

Hey @lloydi—thanks for taking the time to write this up. I get where you're coming from, but I think that could be super confusing in a couple of scenarios, like if someone wanted to pick a color from the app, or if someone wanted the colour with the shadow. I think the disconnect between the action it looks like they're taking and the result could cause some problems.

Currently I still feel like hiding the app temporarily is the best option, which I'm considering including in the roadmap for 0.0.9. Will keep this open in the meantime.

lloydi commented 3 years ago

OK, I see. I personally can't see whan I'd ever use a color picker app to pick from the app itself (some people are weird, ha!). Maybe the approach of making the app disappear while picking is a go-er, but you could consider that as something to have in prefs (and provides opportunity to explain the shadow issue, maybe).

Anyway, will leave it with you :)

superhighfives commented 3 years ago

From @ovanbiervliet on #38:

Pika 0.0.9-beta1 build 12 introduces the hiding functionality while color picking.

Although I like the idea of this, I'd want to see this refined to only work when the mouse is near the Pika window. There are 2 reasons for this:

  • Often I want to refer to previously sampled color(s) while picking a new one, e.g. to avoid picking the same color etc.
  • Since Pika doesn't currently show the color value near the magnifier, a quick glance to the Pika window helps in picking the right color, when you have to try a few times it gets annoying when the window disappears each time
superhighfives commented 3 years ago

Thanks for the feedback, @ovanbiervliet. I mentioned in a previous comment that things can always fall back to a preference if it's controversial (or drop it entirely), so appreciate you flagging this.

My initial thought was that I'd rather put it in a preference than to change the behaviour based on the mouse position, as I want to avoid any unexpected or undocumented side effects in the UX, where possible. Another option that I considered, but that would violate this, would be only hiding on shortcut rather than when clicking the swatch, or vice-versa.

Speaking of, on:

when you have to try a few times it gets annoying when the window disappears each time

Personally, I've also found this to be a tad frustrating, as sometimes I'll copy a colour from foreground to background to "back it up".

So, all that said, I'm not totally steadfast in my inital position. I think hiding when the mouse is on or near the Pika window is worth exploring in beta 2. As I said, can always fall back to a preference to reduce complexity.

Going to leave this issue open and see what other feedback it gets during the beta, as I'd love to keep the conversation going here.

superhighfives commented 3 years ago

The more I've experimented with this one (different hiding and showing based on mouse position, shortcut type, etc, the more confusing I find the complexity makes the UX. The conclusion I've come to is that it should be tied to the window itself—and not to preferences. By default, Pika stays visible, and if you check this item, it hides itself. That feels like a sensible default, and flexibility for people who want to change it. Going to test this out in the next 0.0.9 beta, so keen for feedback once that's ready shortly.

image

ovanbiervliet commented 3 years ago

Maybe hold a modifier key to hide the Pika window?

"Hold Ctrl to hide the window"

superhighfives commented 3 years ago

Hmm, fair point! Keen to see how the feedback goes for having it in the menu—it'll be in v0.0.9-beta2, which I'm releasing shortly.

superhighfives commented 3 years ago

Shipped with https://github.com/superhighfives/pika/releases/tag/0.0.9 🎉 Really appreciate the feedback!