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

Use d50 referent instead of d65 for lab (and by extension hcl) color space #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChrisLoer
Copy link
Collaborator

I haven't updated the relevant tests yet, but the ones that are failing look like they're failing in ways that look about right, e.g.:

  ● interpolate › interpolate color › should interpolate colors in "lab" color space

    expect(received).toMatchObject(expected)

    - Expected  - 3
    + Received  + 3

      Object {
        "a": NumberCloseTo 0.9 (4 digits),
    -   "b": NumberCloseTo 0.7461000000000001 (4 digits),
    -   "g": NumberCloseTo 0.32084999999999997 (4 digits),
    -   "r": NumberCloseTo 0.3816 (4 digits),
    +   "b": 0.7501995807994258,
    +   "g": 0.3109760521913497,
    +   "r": 0.3567325378913688,

I also haven't figured out how to get this to properly build and incorporate into a maplibre-gl-js package yet.

cc @ibesora

const y = xyz2lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / Yn);
const z = xyz2lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / Zn);
let y, x, z;
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
Copy link

Choose a reason for hiding this comment

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

What does "x, z;" do here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops -- nothing, I think. Left over from a different way of having the variables defined earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants