summaryrefslogtreecommitdiffstats
path: root/qt-ui/graphicsview-common.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-27 16:17:08 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-27 13:00:29 -0800
commitfcc17c717dd0b380803fcbe161376df141b86c61 (patch)
tree4553441dbfb71c5a197f5065bac6acf27e768025 /qt-ui/graphicsview-common.cpp
parent303badd5ceae56185ec8ffee0b8489c5a598babe (diff)
downloadsubsurface-fcc17c717dd0b380803fcbe161376df141b86c61.tar.gz
Move the 'getSacColor' out of old profile and use it.
This patch makes the color of the cylinder pressure use the sac colors. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/graphicsview-common.cpp')
-rw-r--r--qt-ui/graphicsview-common.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/graphicsview-common.cpp b/qt-ui/graphicsview-common.cpp
index 5415cfe1f..4d96aa8c6 100644
--- a/qt-ui/graphicsview-common.cpp
+++ b/qt-ui/graphicsview-common.cpp
@@ -62,3 +62,16 @@ QColor getColor(const color_indice_t i, bool isGrayscale = false)
return profile_color[i].at((isGrayscale) ? 1 : 0);
return QColor(Qt::black);
}
+
+QColor getSacColor(int sac, int avg_sac)
+{
+ int sac_index = 0;
+ int delta = sac - avg_sac + 7000;
+
+ sac_index = delta / 2000;
+ if (sac_index < 0)
+ sac_index = 0;
+ if (sac_index > SAC_COLORS - 1)
+ sac_index = SAC_COLORS - 1;
+ return getColor((color_indice_t)(SAC_COLORS_START_IDX + sac_index), false);
+} \ No newline at end of file