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

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