From 018d5dc4a9b674ab7f7692ac9fdd9b568d69c6a3 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 30 May 2017 14:38:48 -0300 Subject: [PATCH] Fix some color indicators that aren't visible with specific selected colors --- src/app/ui/color_selector.cpp | 3 ++- src/app/ui/color_spectrum.cpp | 2 +- src/app/ui/color_wheel.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/ui/color_selector.cpp b/src/app/ui/color_selector.cpp index bb584b61a..9e79e6a08 100644 --- a/src/app/ui/color_selector.cpp +++ b/src/app/ui/color_selector.cpp @@ -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, diff --git a/src/app/ui/color_spectrum.cpp b/src/app/ui/color_spectrum.cpp index 71dea0b20..788494608 100644 --- a/src/app/ui/color_spectrum.cpp +++ b/src/app/ui/color_spectrum.cpp @@ -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); } } diff --git a/src/app/ui/color_wheel.cpp b/src/app/ui/color_wheel.cpp index 345069580..a74079829 100644 --- a/src/app/ui/color_wheel.cpp +++ b/src/app/ui/color_wheel.cpp @@ -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); } }