From d6893901405d3609df9ec1a321757e59d5c7b670 Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Tue, 18 Oct 2016 08:39:46 +1100 Subject: Heatmap: Show more yellow Stretch out the yellow zone of the HSV scale, because the yellow band of the true scale appears narrow. Signed-off-by: Rick Walsh Signed-off-by: Dirk Hohndel --- profile-widget/diveprofileitem.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'profile-widget/diveprofileitem.cpp') diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 2b7e4e396..240032034 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -393,10 +393,14 @@ QColor DivePercentageItem::ColorScale(double value, int inert) color.setHsvF(0.5 + 0.25 * scaledValue / 0.8, 1.0, 1.0); else if (scaledValue < 1.0) // grade from magenta to black color.setHsvF(0.75, 1.0, (1.0 - scaledValue) / 0.2); - else if (value < AMB_PERCENTAGE) // grade from black to green + else if (value < AMB_PERCENTAGE) // grade from black to bright green color.setHsvF(0.333, 1.0, (value - AMB_PERCENTAGE * inert / 1000.0) / (AMB_PERCENTAGE - AMB_PERCENTAGE * inert / 1000.0)); - else if (value < 100) // grade from green to yellow to red - color.setHsvF(0.333 * (100.0 - value) / (100.0 - AMB_PERCENTAGE), 1.0, 1.0); + else if (value < 65) // grade from bright green (0% M) to yellow-green (30% M) + color.setHsvF(0.333 - 0.133 * (value - AMB_PERCENTAGE) / (65.0 - AMB_PERCENTAGE), 1.0, 1.0); + else if (value < 85) // grade from yellow-green (30% M) to orange (70% M) + color.setHsvF(0.2 - 0.1 * (value - 65.0) / 20.0, 1.0, 1.0); + else if (value < 100) // grade from orange (70% M) to red (100% M) + color.setHsvF(0.1 * (100.0 - value) / 15.0, 1.0, 1.0); else if (value < 120) // M value exceeded - grade from red to white color.setHsvF(0.0, 1 - (value - 100.0) / 20.0, 1.0); else // white -- cgit v1.2.3-70-g09d2