Fix incorrect font color detection for DeviceView (threshold 50)

This commit is contained in:
k1-801
2020-09-04 22:52:53 +04:00
committed by Adam Honse
parent 8823e28fa0
commit 290fddaf55

View File

@@ -503,7 +503,9 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
font.setPixelSize(posh / 2);
painter.setFont(font);
if(currentColor.value() > 127)
unsigned int luma = (unsigned int)(0.2126f * currentColor.red() + 0.7152f * currentColor.green() + 0.0722f * currentColor.blue());
if(luma > 127)
{
painter.setPen(Qt::black);
}