Skip to content
Snippets Groups Projects

Use a more random hash to generate user colors

Merged Nicolas Werner requested to merge more-random-colors into master
+ 1
1
@@ -656,7 +656,7 @@ utils::generateContrastingHexColor(const QString &input, const QColor &backgroun
auto hash = hashQString(input);
// create a hue value based on the hash of the input.
// Adapted to make Nico blue
auto userHue = static_cast<int>((hash - 45) % 360);
auto userHue = static_cast<int>((hash - static_cast<uint32_t>(45)) % 360);
// start with moderate saturation and lightness values.
auto sat = 230;
auto lightness = 125;
Loading