MCPcopy Create free account
hub / github.com/KDE/kdevelop / readabilityContrast

Function readabilityContrast

plugins/quickopen/expandingtree/expandingdelegate.cpp:56–61  ·  view source on GitHub ↗

A hack to compute more eye-focused contrast values

Source from the content-addressed store, hash-verified

54
55//A hack to compute more eye-focused contrast values
56static double readabilityContrast(QColor foreground, QColor background)
57{
58 dampColors(foreground);
59 dampColors(background);
60 return abs(foreground.green() - background.green()) + abs(foreground.red() - background.red()) + abs(foreground.blue() - background.blue());
61}
62
63void ExpandingDelegate::paint(QPainter* painter, const QStyleOptionViewItem& optionOld, const QModelIndex& index) const
64{

Callers 1

drawDisplayMethod · 0.85

Calls 1

dampColorsFunction · 0.85

Tested by

no test coverage detected