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

Provide option for picker to use CSS color defined on hover with web page picks #32

Closed
lloydi opened this issue Feb 4, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@lloydi
Copy link

lloydi commented Feb 4, 2021

OK, this may be damn near impossible, but I'll throw it in regardless.

One of the biggest problems I find when using the colour picker to assess the text colour, while auditing a website, is that when the font size is small you have to be very very precise to pick the darkest part of the letter in order to get an accurate reading. But often, because of the way the fonts are rendered, that reading is still not quite accurate. One technique that I have used to get around this problem is to temporarily zoom the page to an extremely large size, and then pick the colour from the font, and then reset the page size.

Now, if there were an option to hold down a modifier key whilst doing the pick, for example holding down the option key, if the item directly underneath the picker at the time is in a webpage, would it be possible to interrogate that element and identify what the CSS colour attribute is? Thus, if you are trying to pick from a 10 pixel font size, and are not getting an accurate reading using the colour picker, then it could offer up the programmatically determined CSS value instead.

Mission:Impossible?

@lloydi lloydi added the enhancement New feature or request label Feb 4, 2021
@superhighfives
Copy link
Owner

Hey @lloydi! Thanks for the suggestion. Currently Pika only has access to the onscreen colours, through the https://developer.apple.com/documentation/appkit/nscolorsampler API. In terms of your use case, a browser extension should have access to the DOM of the website itself, which would allow it to grab the exact colours from the CSS. Chrome's DevTools has ways of doing this, but the UI is a little tricky if you haven't used it before.

I'd love to be able to have that level of granular control for colour picking—knowing what's beneath the cursor, and reacting accordingly—but unfortunately it's currently out of scope with the API I'm using.

Going to close this one, but again, really appreciate the suggestion!

@lloydi
Copy link
Author

lloydi commented Feb 4, 2021

Oh yeah, I'm completely familiar with the various dev tools implementations of this .... but your app is so nice, that I wanted to have that capability in there too :D

The reason for wanting it is that sometimes the browser tools are not able to identify the contrast issues. If they don't flag it as an issue, you can't use the tools to adjust the color to meet the WCAG pass level (which is a pain). Then it's down to using the external color picker app to do the necessary :)

I knew this was a long-shot, but always worth asking just in case.

@superhighfives
Copy link
Owner

Yeah, I'd love to have more granularity generally. The NSColorSampler API seems really minimal, though, and rolling my own would mean that every who downloads it needs to enable Screen Recording, which is an awkward process. But it does mean there's no way to address #8, or to allow moving the sampler via the keyboard for #28. Fingers crossed the API gets expanded safely in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants