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

Method colorForId

kdevplatform/util/widgetcolorizer.cpp:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53QColor WidgetColorizer::colorForId(uint id, const QPalette& activePalette, bool forBackground)
54{
55 const int high = 255;
56 const int low = 100;
57 auto color = QColor(qAbs(id % (high - low)),
58 qAbs((id / 50) % (high - low)),
59 qAbs((id / (50 * 50)) % (high - low)));
60 const auto& foreground = activePalette.windowText().color();
61 const auto& background = activePalette.window().color();
62 if (forBackground) {
63 return blendBackground(color, .5, foreground, background);
64 } else {
65 return blendForeground(color, .5, foreground, background);
66 }
67}
68
69bool WidgetColorizer::colorizeByProject()
70{

Callers

nothing calls this directly

Calls 2

QColorClass · 0.85
windowMethod · 0.80

Tested by

no test coverage detected