Moved getRandomColor method to util/Helpers.cpp (#2974)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user