Adjust highlight color only when hue or saturation is above threshold

This commit is contained in:
Magne Sjaastad 2023-08-11 12:51:22 +02:00
parent 267aee9d91
commit beb43c585c

View File

@ -1031,11 +1031,17 @@ void RiuQwtPlotWidget::highlightPlotCurves( const std::set<const QwtPlotItem*>&
double zValue = plotCurve->z();
if ( closestItems.count( plotCurve ) > 0 )
{
auto saturation = 1.0;
auto value = 1.0;
auto hue = curveColor.hueF();
auto highlightColor = curveColor;
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.setWidth( penWidth + highlightItemWidthAdjustment() );