From 20dd116e6f728645b4c9c8ba6c74f535759d7a1a Mon Sep 17 00:00:00 2001 From: Jens Steinhauser Date: Thu, 3 Sep 2015 14:47:13 +0200 Subject: [PATCH] ViewItem: Adjust the threshold between dark and light colors Previously, the function returned 'Qt::black' for all used colors except when black itself was passed in, making the text on brown, blue or violet backgrounds very hard to read. --- pv/view/viewitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index 55243860..a9c9b3dd 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -107,7 +107,7 @@ void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp) QColor ViewItem::select_text_colour(QColor background) { - return (background.lightness() > 64) ? Qt::black : Qt::white; + return (background.lightness() > 110) ? Qt::black : Qt::white; } } // namespace view -- 2.30.2