Debian Codegraph @

node/colorjs.io/src/spaces/prophoto-linear.js

raw
1 import RGBColorSpace from "../RGBColorSpace.js";
2 import XYZ_D50 from "./xyz-d50.js";
3
4 /** @import { Matrix3x3 } from "../types.js" */
5
6 /**
7 * Matrices used by this color space, also available as `ProPhoto_Linear.M`.
8 * Uses D50 (so no chromatic adaptation needed afterwards). The matrix cannot
9 * be expressed in rational form, but is calculated to 64 bit accuracy.
10 * see https://github.com/w3c/csswg-drafts/issues/7675
11 * @type {Record<string, Matrix3x3>}
12 */
13 // prettier-ignore
14 export const M = {
15 toXYZ: [
16 [ 0.79776664490064230, 0.13518129740053308, 0.03134773412839220 ],
17 [ 0.28807482881940130, 0.71183523424187300, 0.00008993693872564 ],
18 [ 0.00000000000000000, 0.00000000000000000, 0.82510460251046020 ],
19 ],
20 fromXYZ: [
21 [ 1.34578688164715830, -0.25557208737979464, -0.05110186497554526 ],
22 [ -0.54463070512490190, 1.50824774284514680, 0.02052744743642139 ],
23 [ 0.00000000000000000, 0.00000000000000000, 1.21196754563894520 ],
24 ],
25 };
26
27 export default new RGBColorSpace({
28 id: "prophoto-linear",
29 cssId: "--prophoto-rgb-linear",
30 name: "Linear ProPhoto",
31 white: "D50",
32 base: XYZ_D50,
33 M,
34 });