-
Notifications
You must be signed in to change notification settings - Fork 82
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
[contrast / deltaPhi] #209
Conversation
New contrast module, deltaPhiStar 𝜟𝜱✴︎ https://github.com/Myndex/deltaphistar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you! |
src/contrast/deltaPhi.js
Outdated
color1 = getColor(color1); | ||
color2 = getColor(color2); | ||
|
||
let Lstr1 = YtoLstar(Math.max(getLuminance(color1), 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest instead the simpler:
let Lstr1 = get(color1, [lab, "l"]);
I see that negative luminance is clamped to zero; is there a particular risk of negative luminance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...is there a particular risk of negative luminance?
No, I was literally just following the pattern of the other contrast modules here. I started this module based on Weber.js, which had the same clamp. I am not familiar enough with the total color.js library to know what is an important pattern...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fe321fa updates deltaPhi.js to ~match Lstar.js, except using lab-d65.js
Added a d65 version of lab, for use with DeltaPhiStar
fix import lab_d65
Updates the types to include changes that were missed in v0.4.1, specifically from PR's color-js#209 and color-js#219.
New contrast module, deltaPhiStar 𝜟𝜱✴︎
https://github.com/Myndex/deltaphistar
This version is approximately aligned with APCA light mode.
deltaPhiStar 𝜟𝜱✴︎ is symmetric and does not consider polarity. It is intended as a general purpose perceptual contrast method, which is similar to APCA, and useable for high spatial frequency stimuli on self-illuminated monitors.
May be particularly useful for dataviz elements.