From d49cc6db9709ea50a20ea939f9074633092e395b Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sun, 22 Nov 2020 14:27:51 +0100 Subject: [PATCH] Change color gamut project 2 aufgabe 3 --- projects/project-2/aufgabe3.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/projects/project-2/aufgabe3.js b/projects/project-2/aufgabe3.js index c03f7d0..321980d 100644 --- a/projects/project-2/aufgabe3.js +++ b/projects/project-2/aufgabe3.js @@ -32,28 +32,26 @@ const aufgabe3 = async () => { return [].concat(...apiData) } - const levels = [0, 50, 80, 85, 90, 95, 99, 100] + const levels = [0, 50.0, 80.0, 85.0, 90.0, 95.0, 99.0, 99.9] const getColor = percentage => { switch (true) { case percentage > levels[7]: - return '#800026' + return '#00FF00' case percentage > levels[6]: - return '#BD0026' + return '#33CC00' case percentage > levels[5]: - return '#E31A1C' + return '#4DB300' case percentage > levels[4]: - return '#FC4E2A' + return '#808000' case percentage > levels[3]: - return '#FD8D3C' + return '#996600' case percentage > levels[2]: - return '#FEB24C' + return '#B34D00' case percentage > levels[1]: - return '#FED976' + return '#CC3300' case percentage > levels[0]: - return '#FFEDA0' - default: - return '#ffdea1' + return '#FF0000' } } @@ -85,7 +83,7 @@ const aufgabe3 = async () => { for (let i = 0; i < levels.length; i++) { labels.push( - ' ' + ' ' + levels[i] + (levels[i + 1] ? '–' + levels[i + 1] : '+') ) } @@ -166,7 +164,6 @@ const aufgabe3 = async () => { } L.control.layers(layers, null).addTo(map) - } aufgabe3()