Skip to content

Commit 290fdda

Browse files
k1-801CalcProgrammer1
authored andcommitted
Fix incorrect font color detection for DeviceView (threshold 50)
1 parent 8823e28 commit 290fdda

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

qt/DeviceView.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,9 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
503503
font.setPixelSize(posh / 2);
504504
painter.setFont(font);
505505

506-
if(currentColor.value() > 127)
506+
unsigned int luma = (unsigned int)(0.2126f * currentColor.red() + 0.7152f * currentColor.green() + 0.0722f * currentColor.blue());
507+
508+
if(luma > 127)
507509
{
508510
painter.setPen(Qt::black);
509511
}

0 commit comments

Comments
 (0)