From f6449cdd8dd074f6c40aa7dc197ab6d75411eba5 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 23 Jun 2019 20:26:25 +0200 Subject: [PATCH] Bug fix on color --- .idea/workspace.xml | 20 ++++++++++---------- Functions - Q2.py | 8 ++++++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ed34513..6d838ff 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,7 @@ - - + + @@ -155,12 +155,12 @@ 1561208892308 - + - @@ -213,7 +213,7 @@ - + @@ -222,8 +222,8 @@ - - + + diff --git a/Functions - Q2.py b/Functions - Q2.py index d336f5b..5a192fc 100644 --- a/Functions - Q2.py +++ b/Functions - Q2.py @@ -73,8 +73,12 @@ def getColorsRanges(min, max, mean, parts) : # renvoie liste de [Valeur [Rouge, for i in range(parts) : oneColor = [0, [0, 0, 0]] # [Valeur [Rouge, Vert, Bleu]] oneColor[0] = colorValues[i] - oneColor[1][0] = 1.0 - (i / (parts-1)) # Rouge - oneColor[1][1] = i / (parts - 1) # Vert + if (i < parts / 2) : + oneColor[1][0] = 1.0 # Rouge + oneColor[1][1] = i / (parts / 2) # Vert + else : + oneColor[1][0] = 1.0 - ((i - parts / 2) / (parts-1)) # Rouge + oneColor[1][1] = 1.0 # Vert colorRanges.append(oneColor) return colorRanges -- GitLab