mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
303badd5ce
commit
fcc17c717d
3 changed files with 18 additions and 3 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue