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.

colorspace: Remove unused methods.

Priyank Patelcafe2b4d11ef
diff --git a/frontend_tests/node_tests/colorspace.js b/frontend_tests/node_tests/colorspace.js
index 14c5d75f029..91ac62f9bc0 100644
--- a/frontend_tests/node_tests/colorspace.js
+++ b/frontend_tests/node_tests/colorspace.js
@@ -37,37 +37,3 @@ run_test("luminance_to_lightness", () => {
actual_value = colorspace.luminance_to_lightness(luminance);
assert.equal(actual_value, expected_value);
});
-
-run_test("getDecimalColor", () => {
- const hex_color = "#1f293b";
- const expected_value = {
- r: 31,
- g: 41,
- b: 59,
- };
- const actual_value = colorspace.getDecimalColor(hex_color);
- assert.deepEqual(actual_value, expected_value);
-});
-
-run_test("getLighterColor", () => {
- const rgb_color = {
- r: 31,
- g: 41,
- b: 59,
- };
- const lightness = 0;
- const expected_value = rgb_color;
- const actual_value = colorspace.getLighterColor(rgb_color, lightness);
- assert.deepEqual(actual_value, expected_value);
-});
-
-run_test("getHexColor", () => {
- const rgb_color = {
- r: 31,
- g: 41,
- b: 59,
- };
- const expected_value = "#1f293b";
- const actual_value = colorspace.getHexColor(rgb_color);
- assert.equal(actual_value, expected_value);
-});
diff --git a/static/js/colorspace.js b/static/js/colorspace.js
index 3d49a09d316..38633a8d94d 100644
--- a/static/js/colorspace.js
+++ b/static/js/colorspace.js
@@ -30,28 +30,3 @@ export function luminance_to_lightness(luminance) {
return 116 * v - 16;
}
-
-export function getDecimalColor(hexcolor) {
- return {
- r: Number.parseInt(hexcolor.slice(1, 3), 16),
- g: Number.parseInt(hexcolor.slice(3, 5), 16),
- b: Number.parseInt(hexcolor.slice(5, 7), 16),
- };
-}
-
-export function getLighterColor(rgb, lightness) {
- return {
- r: Math.round(lightness * 255 + (1 - lightness) * rgb.r),
- g: Math.round(lightness * 255 + (1 - lightness) * rgb.g),
- b: Math.round(lightness * 255 + (1 - lightness) * rgb.b),
- };
-}
-
-export function getHexColor(rgb) {
- return (
- "#" +
- Number.parseInt(rgb.r, 10).toString(16) +
- Number.parseInt(rgb.g, 10).toString(16) +
- Number.parseInt(rgb.b, 10).toString(16)
- );
-}