@@ -2956,24 +2956,24 @@ function lin_sRGB_to_XYZ(rgb) {
29562956 // convert an array of linear-light sRGB values to CIE XYZ
29572957 // using sRGB's own white, D65 (no chromatic adaptation)
29582958 // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
2959- var M = math .matrix([
2959+ var M = Math .matrix([
29602960 [0.4124564, 0.3575761, 0.1804375] ,
29612961 [0.2126729, 0.7151522, 0.0721750] ,
29622962 [0.0193339, 0.1191920, 0.9503041]
29632963 ]);
29642964
2965- return math .multiply(M, rgb).valueOf();
2965+ return Math .multiply(M, rgb).valueOf();
29662966}
29672967
29682968function XYZ_to_lin_sRGB(XYZ) {
29692969 // convert XYZ to linear-light sRGB
2970- var M = math .matrix([
2970+ var M = Math .matrix([
29712971 [ 3.2404542, -1.5371385, -0.4985314] ,
29722972 [-0.9692660, 1.8760108, 0.0415560] ,
29732973 [ 0.0556434, -0.2040259, 1.0572252]
29742974 ]);
29752975
2976- return math .multiply(M, XYZ).valueOf();
2976+ return Math .multiply(M, XYZ).valueOf();
29772977}
29782978
29792979// image-p3-related functions
@@ -3009,25 +3009,25 @@ function lin_P3_to_XYZ(rgb) {
30093009 // convert an array of linear-light P3 values to CIE XYZ
30103010 // using D65 (no chromatic adaptation)
30113011 // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
3012- var M = math .matrix([
3012+ var M = Math .matrix([
30133013 [0.4865709486482162, 0.26566769316909306, 0.1982172852343625] ,
30143014 [0.2289745640697488, 0.6917385218365064, 0.079286914093745] ,
30153015 [0.0000000000000000, 0.04511338185890264, 1.043944368900976]
30163016 ]);
30173017 // 0 was computed as -3.972075516933488e-17
30183018
3019- return math .multiply(M, rgb).valueOf();
3019+ return Math .multiply(M, rgb).valueOf();
30203020}
30213021
30223022function XYZ_to_lin_P3(XYZ) {
30233023 // convert XYZ to linear-light P3
3024- var M = math .matrix([
3024+ var M = Math .matrix([
30253025 [ 2.493496911941425, -0.9313836179191239, -0.40271078445071684] ,
30263026 [-0.8294889695615747, 1.7626640603183463, 0.023624685841943577] ,
30273027 [ 0.03584583024378447, -0.07617238926804182, 0.9568845240076872]
30283028 ]);
30293029
3030- return math .multiply(M, XYZ).valueOf();
3030+ return Math .multiply(M, XYZ).valueOf();
30313031}
30323032
30333033//Rec. 2020-related functions
@@ -3053,25 +3053,25 @@ function lin_2020_to_XYZ(rgb) {
30533053 // convert an array of linear-light Rec. 2020 values to CIE XYZ
30543054 // using D65 (no chromatic adaptation)
30553055 // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
3056- var M = math .matrix([
3056+ var M = Math .matrix([
30573057 [0.6369580483012914, 0.14461690358620832, 0.1688809751641721] ,
30583058 [0.2627002120112671, 0.6779980715188708, 0.05930171646986196] ,
30593059 [0.000000000000000, 0.028072693049087428, 1.060985057710791]
30603060 ]);
30613061 // 0 is actually calculated as 4.994106574466076e-17
30623062
3063- return math .multiply(M, rgb).valueOf();
3063+ return Math .multiply(M, rgb).valueOf();
30643064}
30653065
30663066function XYZ_to_lin_2020(XYZ) {
30673067 // convert XYZ to linear-light Rec. 2020
3068- var M = math .matrix([
3068+ var M = Math .matrix([
30693069 [1.7166511879712674, -0.35567078377639233, -0.25336628137365974] ,
30703070 [-0.6666843518324892, 1.6164812366349395, 0.01576854581391113] ,
30713071 [0.017639857445310783, -0.042770613257808524, 0.9421031212354738]
30723072 ]);
30733073
3074- return math .multiply(M, XYZ).valueOf();
3074+ return Math .multiply(M, XYZ).valueOf();
30753075}
30763076
30773077// Chromatic adaptation
@@ -3083,24 +3083,24 @@ function D65_to_D50(XYZ) {
30833083 // - scale components from one reference white to another
30843084 // - convert back to XYZ
30853085 // http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
3086- var M = math .matrix([
3086+ var M = Math .matrix([
30873087 [ 1.0478112, 0.0228866, -0.0501270] ,
30883088 [ 0.0295424, 0.9904844, -0.0170491] ,
30893089 [-0.0092345, 0.0150436, 0.7521316]
30903090 ]);
30913091
3092- return math .multiply(M, XYZ).valueOf();
3092+ return Math .multiply(M, XYZ).valueOf();
30933093}
30943094
30953095function D50_to_D65(XYZ) {
30963096 // Bradford chromatic adaptation from D50 to D65
3097- var M = math .matrix([
3097+ var M = Math .matrix([
30983098 [ 0.9555766, -0.0230393, 0.0631636] ,
30993099 [-0.0282895, 1.0099416, 0.0210077] ,
31003100 [ 0.0122982, -0.0204830, 1.3299098]
31013101 ]);
31023102
3103- return math .multiply(M, XYZ).valueOf();
3103+ return Math .multiply(M, XYZ).valueOf();
31043104}
31053105
31063106// Lab and LCH
0 commit comments