davidhurka added a comment.
Erm, my Okular 1.6.2 already does this, just with another threshold. Below value() = 129, the text (and the header) become white, above value() = 128, they become black. While searching for the code, I just found ui/drawingtoolactions.cpp:48, which does something similar: // draw check mark const int lightness = ((color.red() * 299) + (color.green() * 587) + (color.blue() * 114)) / 1000; p.setPen( lightness < 128 ? Qt::white : Qt::black ); p.drawText( QRect( QPoint( 0, 0 ), pmSel.size() ), Qt::AlignCenter, QStringLiteral("\u2713") ); Is it possible that Qt automatically sets the text color based on the background color, when the text color is not explicitely given? REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D19542 To: yurchor, #okular Cc: davidhurka, aacid, okular-devel, tfella, ngraham, darcyshen