Fix a few conversions

This commit is contained in:
Nicolas Werner 2023-10-29 20:38:54 +01:00
parent 4faeae5c73
commit 50bce25838
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 10 additions and 8 deletions

View file

@ -632,7 +632,8 @@ rainbowify(cmark_node *node)
// get correct color for char index
// Use colors as described here:
// https://shark.comfsm.fm/~dleeling/cis/hsl_rainbow.html
auto color = QColor::fromHslF((charIdx - 1.0) / textLen * (5. / 6.), 0.9, 0.5);
auto color = QColor::fromHslF(
static_cast<float>((charIdx - 1.0) / textLen * (5. / 6.)), 0.9f, 0.5f);
// format color for HTML
auto colorString = color.name(QColor::NameFormat::HexRgb);
// create HTML element for current char