Moved getRandomColor method to util/Helpers.cpp (#2974)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-07-08 19:09:31 +02:00
committed by GitHub
parent 24aee42171
commit b6ee2280d2
4 changed files with 28 additions and 33 deletions
+1 -16
View File
@@ -5,9 +5,9 @@
#include "controllers/ignores/IgnorePhrase.hpp"
#include "messages/Message.hpp"
#include "messages/MessageElement.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "singletons/Settings.hpp"
#include "singletons/WindowManager.hpp"
#include "util/Helpers.hpp"
#include "util/StreamerMode.hpp"
#include <QFileInfo>
@@ -88,21 +88,6 @@ SharedMessageBuilder::SharedMessageBuilder(
{
}
namespace {
QColor getRandomColor(const QString &v)
{
int colorSeed = 0;
for (const auto &c : v)
{
colorSeed += c.digitValue();
}
const auto colorIndex = colorSeed % TWITCH_USERNAME_COLORS.size();
return TWITCH_USERNAME_COLORS[colorIndex];
}
} // namespace
void SharedMessageBuilder::parse()
{
this->parseUsernameColor();