Improve history curve color and symbols

This commit is contained in:
Magne Sjaastad
2022-06-27 15:30:21 +02:00
parent cb1c94630b
commit e5cf5f4cf3
12 changed files with 137 additions and 51 deletions

View File

@@ -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 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -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();

View File

@@ -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 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -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 );