We currently always use the XYZ space with the D65 white point as our universal conversion space (the space we require each type to be able to convert to and from), but this is not ideal when converting between colors like ProPhotoRGB and Lab, which both use the D50 white point, since it requires an extra two matrix multiplications for the chromatic adaptations to and from D65. Additionally, to support color(xyz ...), which also use D50, we will need an explicit XYZ color with a D50 white point. We can solve both of these problems by further generalizing XYZA<T> to support a white point parameter, XYZA<T, WhitePoint>, and annotate all the colors with which whitepoint they are defined in (or what XYZA color is their reference). Then, we can use that information to lazily (though at compile time) determine whether chromatic adaptation is needed in the generic conversion functions.
Created attachment 418835 [details] Patch
Created attachment 418836 [details] Patch
Committed r272146: <https://trac.webkit.org/changeset/272146> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418836 [details].
<rdar://problem/73833214>