Fix some color indicators that aren't visible with specific selected colors

This commit is contained in:
David Capello 2017-05-30 14:38:48 -03:00
parent afdf156a0e
commit 018d5dc4a9
3 changed files with 5 additions and 4 deletions

View File

@ -204,10 +204,11 @@ void ColorSelector::onPaintAlphaBar(ui::Graphics* g, const gfx::Rect& rc)
{
draw_alpha_slider(g, rc, m_color);
const double lit = m_color.getHslLightness();
const int alpha = m_color.getAlpha();
const gfx::Point pos(rc.x + int(rc.w * alpha / 255),
rc.y + rc.h/2);
paintColorIndicator(g, pos, false);
paintColorIndicator(g, pos, lit < 0.5);
}
void ColorSelector::paintColorIndicator(ui::Graphics* g,

View File

@ -100,7 +100,7 @@ void ColorSpectrum::onPaintBottomBar(ui::Graphics* g, const gfx::Rect& rc)
double sat = m_color.getHslSaturation();
gfx::Point pos(rc.x + int(double(rc.w) * sat),
rc.y + rc.h/2);
paintColorIndicator(g, pos, false);
paintColorIndicator(g, pos, lit < 0.5);
}
}

View File

@ -191,7 +191,7 @@ void ColorWheel::onPaintMainArea(ui::Graphics* g, const gfx::Rect& rc)
gfx::Point(int(+std::cos(PI*angle/180.0)*double(m_wheelRadius)*dist),
int(-std::sin(PI*angle/180.0)*double(m_wheelRadius)*dist));
paintColorIndicator(g, pos, false);
paintColorIndicator(g, pos, color.getHsvValue() < 0.5);
g->fillRect(gfx::rgba(color.getRed(),
color.getGreen(),
@ -221,7 +221,7 @@ void ColorWheel::onPaintBottomBar(ui::Graphics* g, const gfx::Rect& rc)
double val = m_color.getHsvValue();
gfx::Point pos(rc.x + int(double(rc.w) * val),
rc.y + rc.h/2);
paintColorIndicator(g, pos, false);
paintColorIndicator(g, pos, val < 0.5);
}
}