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

Difference in readings on same machine and colors with Colour Contrast Analyser and Pika #136

Open
lloydi opened this issue Dec 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@lloydi
Copy link

lloydi commented Dec 11, 2024

I was checking a recent update of the CCA tool (TPGi), and did a quick comparison. I note that despite picking the same colors (and both tools reading the same Hex value), the contrast ratio was different.

Color 1: #343a40
Color 2: #3e444a

Pika reports 1.17:1
CCA reports 1.2:1

image

Why do they differ?
More importantly, which one is correct?

For info, I have PIKA set to the sRGB color space:

image

If choose system default, the color picker hex values do not match what CCA has.

@lloydi lloydi added the bug Something isn't working label Dec 11, 2024
@superhighfives
Copy link
Owner

I'm not 100% sure how CCA handles working out colour contrast—you can see all the logic for how Pika compares colours here: https://github.com/superhighfives/pika/blob/main/Pika/Extensions/Cula.swift

Super happy to make changes to that logic if anything looks off, but without knowing exactly how CCA is coming to that number it's hard for me to troubleshoot.

@superhighfives
Copy link
Owner

Oh sweet, the source code is available! 👍 https://github.com/ThePacielloGroup/CCAe

Will take a look.

@lloydi
Copy link
Author

lloydi commented Dec 19, 2024

And maybe @ferllings will know why these might differ?

@superhighfives
Copy link
Owner

Hmmm, looks like CCA doesn't handle colour spaces, so it's likely whatever that version of Electron defines as the default.

@ferllings
Copy link

No, the color space will only affect the captured color, that would have result in different hex values.
@lloydi could you check the ratio precision, on the Options panel. That might be set to 1 decimal place, and the result have been rounded.
@superhighfives btw, I like your tool, nice design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants