From: Jens Steinhauser Date: Thu, 3 Sep 2015 12:47:13 +0000 (+0200) Subject: ViewItem: Adjust the threshold between dark and light colors X-Git-Tag: pulseview-0.3.0~114 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=20dd116e6f728645b4c9c8ba6c74f535759d7a1a;p=pulseview.git 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. --- 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