Skip to content

Commit 9c4db75

Browse files
committed
[css-color-4] Update chromatic adaptation matrices to higher precision
1 parent 4bd3561 commit 9c4db75

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

css-color-4/conversions.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ function D65_to_D50(XYZ) {
305305
// - convert from XYZ to retinal cone domain
306306
// - scale components from one reference white to another
307307
// - convert back to XYZ
308-
// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
308+
// see https://github.com/LeaVerou/color.js/pull/354/files
309+
309310
var M = [
310-
[ 1.0479298208405488, 0.022946793341019088, -0.05019222954313557 ],
311-
[ 0.029627815688159344, 0.990434484573249, -0.01707382502938514 ],
312-
[ -0.009243058152591178, 0.015055144896577895, 0.7518742899580008 ]
311+
[ 1.0479297925449969, 0.022946870601609652, -0.05019226628920524 ],
312+
[ 0.02962780877005599, 0.9904344267538799, -0.017073799063418826 ],
313+
[ -0.009243040646204504, 0.015055191490298152, 0.7518742814281371 ]
313314
];
314315

315316
return multiplyMatrices(M, XYZ);
@@ -318,9 +319,9 @@ function D65_to_D50(XYZ) {
318319
function D50_to_D65(XYZ) {
319320
// Bradford chromatic adaptation from D50 to D65
320321
var M = [
321-
[ 0.9554734527042182, -0.023098536874261423, 0.0632593086610217 ],
322-
[ -0.028369706963208136, 1.0099954580058226, 0.021041398966943008 ],
323-
[ 0.012314001688319899, -0.020507696433477912, 1.3303659366080753 ]
322+
[ 0.947386632323667, 0.28196156725620036, -0.1708280666484637 ],
323+
[ -0.7357288996314816, 1.6804471734451398, 0.035992069603406264 ],
324+
[ 0.029218329379919382, -0.05145129980782719, 0.7733468362356041 ]
324325
];
325326

326327
return multiplyMatrices(M, XYZ);

0 commit comments

Comments
 (0)