mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Adjust highlight color only when hue or saturation is above threshold
This commit is contained in:
@@ -1031,11 +1031,17 @@ void RiuQwtPlotWidget::highlightPlotCurves( const std::set<const QwtPlotItem*>&
|
|||||||
double zValue = plotCurve->z();
|
double zValue = plotCurve->z();
|
||||||
if ( closestItems.count( plotCurve ) > 0 )
|
if ( closestItems.count( plotCurve ) > 0 )
|
||||||
{
|
{
|
||||||
auto saturation = 1.0;
|
auto highlightColor = curveColor;
|
||||||
auto value = 1.0;
|
|
||||||
auto hue = curveColor.hueF();
|
|
||||||
|
|
||||||
auto highlightColor = QColor::fromHsvF( hue, saturation, value );
|
const double threshold = 0.05;
|
||||||
|
if ( curveColor.hsvHueF() > threshold || curveColor.saturationF() > threshold )
|
||||||
|
{
|
||||||
|
auto saturation = 1.0;
|
||||||
|
auto value = 1.0;
|
||||||
|
auto hue = curveColor.hueF();
|
||||||
|
|
||||||
|
highlightColor = QColor::fromHsvF( hue, saturation, value );
|
||||||
|
}
|
||||||
|
|
||||||
existingPen.setColor( highlightColor );
|
existingPen.setColor( highlightColor );
|
||||||
existingPen.setWidth( penWidth + highlightItemWidthAdjustment() );
|
existingPen.setWidth( penWidth + highlightItemWidthAdjustment() );
|
||||||
|
|||||||
Reference in New Issue
Block a user