summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-03-28 20:56:08 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-03-28 20:56:08 +0200
commitfa68ae9fe99e29ae27dd00d6b00d65fdde4ec6c8 (patch)
treee45e93c39f8d6bd41fd72b41bfe3503cad5b30b0 /src
parentFix emojis being split by rainbows (diff)
downloadnheko-fa68ae9fe99e29ae27dd00d6b00d65fdde4ec6c8.tar.xz
Tweak rainbow slightly
Diffstat (limited to 'src')
-rw-r--r--src/Utils.cpp5
1 files changed, 4 insertions, 1 deletions
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