diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/color.cpp | 11 | ||||
-rw-r--r-- | core/color.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/core/color.cpp b/core/color.cpp index e63f6e569..e86b9f62b 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -87,3 +87,14 @@ QColor getSacColor(int sac, int avg_sac) sac_index = SAC_COLORS - 1; return getColor((color_indice_t)(SAC_COLORS_START_IDX + sac_index), false); } + +QColor getPressureColor(double density) +{ + QColor color; + + int h = ((int) (180.0 - 180.0 * density / 8.0)); + while (h < 0) + h += 360; + color.setHsv(h , 255, 255); + return color; +} diff --git a/core/color.h b/core/color.h index bd0dbad3a..ef60d17d3 100644 --- a/core/color.h +++ b/core/color.h @@ -142,6 +142,7 @@ extern QMap<color_indice_t, QVector<QColor> > profile_color; void fill_profile_color(); QColor getColor(const color_indice_t i, bool isGrayscale = false); QColor getSacColor(int sac, int diveSac); +QColor getPressureColor(double density); struct text_render_options { double size; color_indice_t color; |