- commit
- 77bbdc7d5a3793d3c33466ca536ab1e172f1807e
- parent
- 0c20f03f8b7f982cb08158024a8370a6057f35ca
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-02-15 06:35
make sure rgb color is in [0,255]
Diffstat
| M | js/color.js | 1 | + |
1 files changed, 1 insertions, 0 deletions
diff --git a/js/color.js b/js/color.js
@@ -14,6 +14,7 @@ var rgbToSrgb = function(c) {
14 14 } else {
15 15 x = Math.pow(c, 1 / 2.4) * 1.055 - 0.055;
16 16 }
-1 17 x = Math.min(Math.max(0, x), 1);
17 18 return x * 255;
18 19 };
19 20