Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

eslint: Fix unicorn/no-zero-fractions.

Anders Kaseorg78ccb15d9e66
diff --git a/frontend_tests/node_tests/colorspace.js b/frontend_tests/node_tests/colorspace.js
index 28026853de9..cbc423ce478 100644
--- a/frontend_tests/node_tests/colorspace.js
+++ b/frontend_tests/node_tests/colorspace.js
@@ -4,11 +4,11 @@ zrequire("colorspace");
run_test("sRGB_to_linear", () => {
let srgb_color = 0.0042;
- let expected_value = 0.0042 / 255.0 / 12.92;
+ let expected_value = 0.0042 / 255 / 12.92;
let actual_value = colorspace.sRGB_to_linear(srgb_color);
assert.equal(actual_value, expected_value);
- srgb_color = 255.0;
+ srgb_color = 255;
expected_value = 1;
actual_value = colorspace.sRGB_to_linear(srgb_color);
assert.equal(actual_value, expected_value);
diff --git a/static/js/colorspace.js b/static/js/colorspace.js
index 5a0e0e50c17..fa6c0a12c3d 100644
--- a/static/js/colorspace.js
+++ b/static/js/colorspace.js
@@ -5,7 +5,7 @@
//
// https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation
exports.sRGB_to_linear = function (v) {
- v = v / 255.0;
+ v = v / 255;
if (v <= 0.04045) {
return v / 12.92;
}