Tweak rainbow slightly

pull/547/head
Nicolas Werner 4 years ago
parent edaeb3ccde
commit fa68ae9fe9
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 5
      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

Loading…
Cancel
Save