changeset 3441:d7ec52232702

afd: improve legend coloring
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 24 May 2019 11:31:43 +0200
parents 8801811bf9f5
children 030dc48382c9
files client/src/components/fairway/AvailableFairwayDepth.vue
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Fri May 24 11:20:54 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Fri May 24 11:31:43 2019 +0200
@@ -427,10 +427,13 @@
       this.pdf.doc.text(">= 250.00 [h]", x + 10, y + 23);
     },
     legendStyle(index) {
-      if (index == 0) return `background-color: ${this.$options.COLORS.LDC};`;
-      if (index < 4)
-        return `background-color: ${this.$options.COLORS.REST[index - 1]};`;
-      return `background-color: ${this.$options.COLORS.HIGHEST};`;
+      const style = {
+        0: `background-color: ${this.$options.COLORS.LDC};`,
+        1: `background-color: ${this.$options.COLORS.REST[0]};`,
+        2: `background-color: ${this.$options.COLORS.REST[1]};`,
+        3: `background-color: ${this.$options.COLORS.HIGHEST};`
+      };
+      return style[index];
     },
     close() {
       this.$store.commit("application/paneSetup", "DEFAULT");