Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/color/p5.Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import {
OKLCH as OKLCHSpace,
contrastWCAG21,
contrastAPCA,
P3
P3,

XYZ_D65 as XYZ_D65Space
} from 'colorjs.io/fn';
import HSBSpace from './color_spaces/hsb.js';

Expand Down Expand Up @@ -1031,6 +1033,11 @@ function color(p5, fn, lifecycles){
p5.Color.addColorMode(OKLAB, OKLab);
p5.Color.addColorMode(OKLCH, OKLCHSpace);

// The fundamental color space to which all colors can be converted (https://colorjs.io/docs/spaces#xyz-d65)
// This needs to be registered with color.js for interpolation to work
// reliably.
ColorSpace.register(XYZ_D65Space);

lifecycles.presetup = function(){
const pInst = this;

Expand Down