From fa68ae9fe99e29ae27dd00d6b00d65fdde4ec6c8 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 28 Mar 2021 20:56:08 +0200 Subject: [PATCH] Tweak rainbow slightly --- src/Utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 50ebbeb5..bf9a8449 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -530,7 +530,10 @@ utils::markdownToHtml(const QString &text, bool rainbowify) } // get correct color for char index - auto color = QColor::fromHsvF((charIdx - 1.0) / textLen, 1.0, 1.0); + // Use colors as described here: + // https://shark.comfsm.fm/~dleeling/cis/hsl_rainbow.html + auto color = + QColor::fromHslF((charIdx - 1.0) / textLen * (5. / 6.), 1.0, 0.5); // format color for HTML auto colorString = color.name(QColor::NameFormat::HexRgb); // create HTML element for current char