Skip to content

Register the XYZ-D65 color space#8807

Draft
dontwanttothink wants to merge 1 commit into
processing:dev-2.0from
dontwanttothink:fix-lerp-crash
Draft

Register the XYZ-D65 color space#8807
dontwanttothink wants to merge 1 commit into
processing:dev-2.0from
dontwanttothink:fix-lerp-crash

Conversation

@dontwanttothink
Copy link
Copy Markdown

Resolves #8806

I'm not sure whether this is the right approach. I didn't want to expose an additional color mode, so the color space is registered with color.js directly. The color space XYZ-D65 needs to be registered somehow, I think, in order for lerp to work between sRGB, Lab and Oklab colors.

Unfortunately, any time I tried to test this change, p5.js crashed with a message complaining about a totally different color space, HSB, being registered twice. Curiously, this happened even when I tried testing the base branch (i.e., without the change).

As a result, I'm submitting this as a draft in case it is of any use.

Changes:

  • Fixed: Attempting to interpolate between colors defined in different color spaces could throw an exception in some cases.

PR Checklist

@welcome
Copy link
Copy Markdown

welcome Bot commented May 17, 2026

🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
🤔 Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
🌸 Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

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.

1 participant