Skip to content

Commit 9420ce0

Browse files
authored
[css-color] Editorial: correct case for JS 'Math'
1 parent 46f4da5 commit 9420ce0

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

css-color/Overview.bs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,24 +2889,24 @@ function lin_sRGB_to_XYZ(rgb) {
28892889
// convert an array of linear-light sRGB values to CIE XYZ
28902890
// using sRGB's own white, D65 (no chromatic adaptation)
28912891
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
2892-
var M = math.matrix([
2892+
var M = Math.matrix([
28932893
[0.4124564, 0.3575761, 0.1804375],
28942894
[0.2126729, 0.7151522, 0.0721750],
28952895
[0.0193339, 0.1191920, 0.9503041]
28962896
]);
28972897

2898-
return math.multiply(M, rgb).valueOf();
2898+
return Math.multiply(M, rgb).valueOf();
28992899
}
29002900

29012901
function XYZ_to_lin_sRGB(XYZ) {
29022902
// convert XYZ to linear-light sRGB
2903-
var M = math.matrix([
2903+
var M = Math.matrix([
29042904
[ 3.2404542, -1.5371385, -0.4985314],
29052905
[-0.9692660, 1.8760108, 0.0415560],
29062906
[ 0.0556434, -0.2040259, 1.0572252]
29072907
]);
29082908

2909-
return math.multiply(M, XYZ).valueOf();
2909+
return Math.multiply(M, XYZ).valueOf();
29102910
}
29112911

29122912
// image-p3-related functions
@@ -2942,25 +2942,25 @@ function lin_P3_to_XYZ(rgb) {
29422942
// convert an array of linear-light P3 values to CIE XYZ
29432943
// using D65 (no chromatic adaptation)
29442944
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
2945-
var M = math.matrix([
2945+
var M = Math.matrix([
29462946
[0.4865709486482162, 0.26566769316909306, 0.1982172852343625],
29472947
[0.2289745640697488, 0.6917385218365064, 0.079286914093745],
29482948
[0.0000000000000000, 0.04511338185890264, 1.043944368900976]
29492949
]);
29502950
// 0 was computed as -3.972075516933488e-17
29512951

2952-
return math.multiply(M, rgb).valueOf();
2952+
return Math.multiply(M, rgb).valueOf();
29532953
}
29542954

29552955
function XYZ_to_lin_P3(XYZ) {
29562956
// convert XYZ to linear-light P3
2957-
var M = math.matrix([
2957+
var M = Math.matrix([
29582958
[ 2.493496911941425, -0.9313836179191239, -0.40271078445071684],
29592959
[-0.8294889695615747, 1.7626640603183463, 0.023624685841943577],
29602960
[ 0.03584583024378447, -0.07617238926804182, 0.9568845240076872]
29612961
]);
29622962

2963-
return math.multiply(M, XYZ).valueOf();
2963+
return Math.multiply(M, XYZ).valueOf();
29642964
}
29652965

29662966
//Rec. 2020-related functions
@@ -2986,25 +2986,25 @@ function lin_2020_to_XYZ(rgb) {
29862986
// convert an array of linear-light Rec. 2020 values to CIE XYZ
29872987
// using D65 (no chromatic adaptation)
29882988
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
2989-
var M = math.matrix([
2989+
var M = Math.matrix([
29902990
[0.6369580483012914, 0.14461690358620832, 0.1688809751641721],
29912991
[0.2627002120112671, 0.6779980715188708, 0.05930171646986196],
29922992
[0.000000000000000, 0.028072693049087428, 1.060985057710791]
29932993
]);
29942994
// 0 is actually calculated as 4.994106574466076e-17
29952995

2996-
return math.multiply(M, rgb).valueOf();
2996+
return Math.multiply(M, rgb).valueOf();
29972997
}
29982998

29992999
function XYZ_to_lin_2020(XYZ) {
30003000
// convert XYZ to linear-light Rec. 2020
3001-
var M = math.matrix([
3001+
var M = Math.matrix([
30023002
[1.7166511879712674, -0.35567078377639233, -0.25336628137365974],
30033003
[-0.6666843518324892, 1.6164812366349395, 0.01576854581391113],
30043004
[0.017639857445310783, -0.042770613257808524, 0.9421031212354738]
30053005
]);
30063006

3007-
return math.multiply(M, XYZ).valueOf();
3007+
return Math.multiply(M, XYZ).valueOf();
30083008
}
30093009

30103010
// Chromatic adaptation
@@ -3016,24 +3016,24 @@ function D65_to_D50(XYZ) {
30163016
// - scale components from one reference white to another
30173017
// - convert back to XYZ
30183018
// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
3019-
var M = math.matrix([
3019+
var M = Math.matrix([
30203020
[ 1.0478112, 0.0228866, -0.0501270],
30213021
[ 0.0295424, 0.9904844, -0.0170491],
30223022
[-0.0092345, 0.0150436, 0.7521316]
30233023
]);
30243024

3025-
return math.multiply(M, XYZ).valueOf();
3025+
return Math.multiply(M, XYZ).valueOf();
30263026
}
30273027

30283028
function D50_to_D65(XYZ) {
30293029
// Bradford chromatic adaptation from D50 to D65
3030-
var M = math.matrix([
3030+
var M = Math.matrix([
30313031
[ 0.9555766, -0.0230393, 0.0631636],
30323032
[-0.0282895, 1.0099416, 0.0210077],
30333033
[ 0.0122982, -0.0204830, 1.3299098]
30343034
]);
30353035

3036-
return math.multiply(M, XYZ).valueOf();
3036+
return Math.multiply(M, XYZ).valueOf();
30373037
}
30383038

30393039
// Lab and LCH

0 commit comments

Comments
 (0)