aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/diveprofileitem.cpp10
1 files changed, 7 insertions, 3 deletions
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