Skip to content

Commit d579ce1

Browse files
committed
fix the example
1 parent 5603e2d commit d579ce1

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

css-color-4/LCH-examples.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
<script src="math.js"></script>
44
<script src="conversions.js"></script>
55
<textarea id="sRGBresults"></textarea>
6-
<textarea id="P3results"></textarea>
7-
<textarea id="Rec2020results"></textarea>
6+
<!-- <textarea id="P3results"></textarea>
7+
<textarea id="Rec2020results"></textarea> -->
88
<script>
99
// convert a sampling of
1010
// several RGB colorspaces
1111
// to Lab and LCH
1212

13-
console.log("sRGB");
13+
console.log("test sRGB");
14+
sRGBresults.value += 'sRGB';
15+
// for (var r =0; r <=1; r+=0.5) {
16+
// for (var g =0; g <=1; g+=0.5) {
17+
// for (var b =0; b <=1; b+=0.5) {
18+
// sRGBresults.value += `RGB=${r},${g},${b}
19+
// `;
20+
// var lab = XYZ_to_Lab(D65_to_D50(lin_sRGB_to_XYZ(lin_sRGB([r, g, b]))));
21+
// sRGBresults.value += `Lab=${lab}
22+
// `;
23+
// sRGBresults.value += `LCH=${Lab_to_LCH(lab)}
1424

15-
for (var r =0; r <=1; r+=0.5) {
16-
for (var g =0; g <=1; g+=0.5) {
17-
for (var b =0; b <=1; b+=0.5) {
18-
sRGBresults.value += `RGB=${r},${g},${b}
19-
`;
20-
var lab = XYZ_to_Lab(D65_to_D50(lin_sRGB_to_XYZ(lin_sRGB([r, g, b]))));
21-
sRGBresults.value += `Lab=${lab}
22-
`;
23-
sRGBresults.value += `LCH=${Lab_to_LCH(lab)}
24-
25-
`;
26-
}
27-
}
28-
};
25+
// `;
26+
// }
27+
// }
28+
// };
2929

3030
console.log("image-p3");
3131

css-color-4/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ function LCH_to_sRGB(LCH) {
4646
// or components greater than 1.0
4747
// so check for that :)
4848

49-
return gam_sRGB(XYZ_to_lin_sRGB(Lab_to_XYZ(D50_to_D65(LCH_to_Lab(LCH)))));
49+
return gam_sRGB(XYZ_to_lin_sRGB(D50_to_D65(Lab_to_XYZ(LCH_to_Lab(LCH)))));
5050
}

0 commit comments

Comments
 (0)