diff options
author | Rick Walsh <rickmwalsh@gmail.com> | 2016-10-18 08:39:46 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-10-20 21:14:27 -0700 |
commit | d6893901405d3609df9ec1a321757e59d5c7b670 (patch) | |
tree | 2ac8c0a6cf6e6a960421446b23b95b9f0826e81e /profile-widget/diveprofileitem.cpp | |
parent | fd46167ae02db9976c45f76d71b752ee5fa3ed31 (diff) | |
download | subsurface-d6893901405d3609df9ec1a321757e59d5c7b670.tar.gz |
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 <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/diveprofileitem.cpp')
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 10 |
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 |