From 1a87e6b084d9ff0f2cd462a3eac378c42e6329ce Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 28 Jun 2021 13:41:07 +0100 Subject: [PATCH] Avoid selecting red as a highlight colour for filters --- qrenderdoc/Windows/EventBrowser.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index 1c3cbe8e7..55f36eee9 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -3238,9 +3238,16 @@ void AddFilterSelections(QTextCursor cursor, int &idx, QColor backCol, QColor fo if(hasMust && f.matchType == MatchType::Normal) ignored = true; - QColor col = QColor::fromHslF(float(idx++ % 6) / 6.0f, ignored ? 0.0f : 1.0f, + // we use 6 colours around the wheel to get reasonable distinction. Note that this is not + // critical information and selecting each entry will underline it in the phrase, since we want + // to be colour blind friendly where possible. + // we avoid the 60 degrees near red (which is at 0) to avoid confusion with errors. + QColor col = QColor::fromHslF((float(idx) / 6.0f) * (300.0f / 360.0f) + (0.5f / 6.0f), + ignored ? 0.0f : 1.0f, qBound(0.05, 0.2 * 0.5 + 0.8 * backCol.lightnessF(), 0.95)); + idx = (idx + 1) % 6; + f.col = col; sel.cursor.setPosition(f.position, QTextCursor::MoveAnchor);