Browse Source

Wrap around highlights to ensure distinguishing

Bright colors are maxed out for highlighting.  Modestly darkening them
helps to distinguish them from their neighbors but keep the blue value
to help "glow" the selection

Fixes https://gitlab.com/kicad/code/kicad/issues/5560
6.0.7
Seth Hillbrand 4 years ago
parent
commit
c69a16ca6d
  1. 14
      common/render_settings.cpp

14
common/render_settings.cpp

@ -64,7 +64,19 @@ void RENDER_SETTINGS::update()
// Linear brightening doesn't work well for colors near white
double factor = ( m_selectFactor * 0.6 ) + pow( m_layerColors[i].GetBrightness(), 3 );
m_layerColorsSel[i] = m_layerColors[i].Brightened( std::min( factor, 1.0 ) );
factor = std::min( 1.0, factor );
m_layerColorsSel[i] = m_layerColors[i].Brightened( factor );
// If we are maxed out on brightening as a highlight, fallback to darkening but keep
// the blue that acts as a "glowing" color
if( std::fabs( m_layerColorsSel[i].GetBrightness() - m_layerColors[i].GetBrightness() )
< 0.05 )
{
m_layerColorsSel[i] = m_layerColors[i].Darkened( m_selectFactor * 0.4 );
m_layerColorsSel[i].b = m_layerColors[i].b * ( 1.0 - factor ) + factor;
}
}
}
Loading…
Cancel
Save