mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve history curve color and symbols
This commit is contained in:
@@ -682,6 +682,16 @@ cvf::Color3f RiaColorTables::phaseColor( RiaDefines::PhaseType phase )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiaColorTables::historyCurveContrastColor()
|
||||
{
|
||||
auto unsignedColor = cvf::Color3ub( 248, 0, 170 ); // Magenta
|
||||
|
||||
return cvf::Color3f( unsignedColor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -81,6 +81,8 @@ public:
|
||||
static std::map<RiaDefines::PhaseType, caf::ColorTable> phaseColors();
|
||||
static cvf::Color3f phaseColor( RiaDefines::PhaseType phase );
|
||||
|
||||
static cvf::Color3f historyCurveContrastColor();
|
||||
|
||||
private:
|
||||
static std::vector<cvf::Color3ub> categoryColors();
|
||||
static std::vector<cvf::Color3ub> contrastCategoryColors();
|
||||
|
||||
@@ -184,6 +184,26 @@ QColor RiaColorTools::blendQColors( const QColor& color1, const QColor& color2,
|
||||
( color1.blue() * weight1 + color2.blue() * weight2 ) / weightsum );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RiaColorTools::makeLighter( const cvf::Color3f& color, float normalizedScalingFactor )
|
||||
{
|
||||
auto qColor = toQColor( color );
|
||||
|
||||
double h = 0.0;
|
||||
double s = 0.0;
|
||||
double l = 0.0;
|
||||
qColor.getHslF( &h, &s, &l );
|
||||
|
||||
l = l + ( 1.0 - l ) * normalizedScalingFactor;
|
||||
l = std::min( 1.0, l );
|
||||
|
||||
qColor.setHslF( h, s, l );
|
||||
|
||||
return fromQColorTo3f( qColor );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
blendCvfColors( const cvf::Color3f& color1, const cvf::Color3f& color2, int weight1 = 1, int weight2 = 1 );
|
||||
static QColor blendQColors( const QColor& color1, const QColor& color2, int weight1 = 1, int weight2 = 1 );
|
||||
|
||||
static cvf::Color3f makeLighter( const cvf::Color3f& color1, float normalizedScalingFactor );
|
||||
|
||||
// Factor > 1 increases saturation, a factor < 1 decreases saturation
|
||||
static QColor modifySaturation( const QColor& color, double factor );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user