#7333 Well Log Plot: Improve Stack Curve with Phase Colors

Improve curve colors when only one curve of a given phase is displayed
Make sure to call the base class directly above current inheritance level
Improve colors
This commit is contained in:
Magne Sjaastad
2021-02-22 08:38:20 +01:00
parent 93a3060757
commit 084835ce66
9 changed files with 91 additions and 15 deletions

View File

@@ -19,6 +19,8 @@
#include "RiaColorTables.h"
#include "RiaColorTools.h"
#include "RiuGuiTheme.h"
#include "cvfAssert.h"
#include <QColor>
@@ -630,6 +632,40 @@ std::map<RiaDefines::PhaseType, caf::ColorTable> RiaColorTables::phaseColors()
{ RiaDefines::PhaseType::OIL_PHASE, caf::ColorTable( oilColors ) } };
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTables::phaseColor( RiaDefines::PhaseType phase )
{
cvf::Color3ub col = cvf::Color3::DARK_GRAY;
QColor themeCol;
if ( phase == RiaDefines::PhaseType::GAS_PHASE )
{
themeCol = RiuGuiTheme::getColorByVariableName( "curveColorGas2" );
col = cvf::Color3ub( 212, 0, 0 );
}
else if ( phase == RiaDefines::PhaseType::OIL_PHASE )
{
themeCol = RiuGuiTheme::getColorByVariableName( "curveColorOil2" );
col = cvf::Color3ub( 0, 204, 0 );
}
else if ( phase == RiaDefines::PhaseType::WATER_PHASE )
{
themeCol = RiuGuiTheme::getColorByVariableName( "curveColorWater2" );
col = cvf::Color3ub( 0, 0, 205 );
}
if ( themeCol.isValid() )
{
return RiaColorTools::fromQColorTo3f( themeCol );
}
else
{
return cvf::Color3f( col );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------