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

[contrast / deltaPhi] #209

Merged
merged 3 commits into from
Aug 23, 2022
Merged

[contrast / deltaPhi] #209

merged 3 commits into from
Aug 23, 2022

Conversation

Myndex
Copy link
Contributor

@Myndex Myndex commented Aug 20, 2022

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.

New contrast module, deltaPhiStar 𝜟𝜱✴︎
https://github.com/Myndex/deltaphistar
Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LeaVerou
Copy link
Member

Thank you!

@LeaVerou LeaVerou requested a review from svgeesus August 20, 2022 11:03
src/contrast/deltaPhi.js Outdated Show resolved Hide resolved
color1 = getColor(color1);
color2 = getColor(color2);

let Lstr1 = YtoLstar(Math.max(getLuminance(color1), 0));
Copy link
Member

@svgeesus svgeesus Aug 21, 2022

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?

Copy link
Contributor Author

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...

Copy link
Contributor Author

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

src/contrast/deltaPhi.js Show resolved Hide resolved
@svgeesus svgeesus requested a review from LeaVerou August 21, 2022 19:52
Added a d65 version of lab, for use with DeltaPhiStar
fix import lab_d65
@svgeesus svgeesus merged commit 34a3d33 into color-js:main Aug 23, 2022
MysteryBlokHed added a commit to MysteryBlokHed/color.js that referenced this pull request Nov 16, 2022
Updates the types to include changes that were missed in v0.4.1,
specifically from PR's color-js#209 and color-js#219.
LeaVerou pushed a commit that referenced this pull request Nov 17, 2022
Updates the types to include changes that were missed in v0.4.1,
specifically from PR's #209 and #219.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants