mirror-chatterino2/src/messages/MessageColor.cpp
2018-06-26 16:37:59 +02:00

34 lines
738 B
C++

#include "MessageColor.hpp"
namespace chatterino {
MessageColor::MessageColor(const QColor &_color)
: type(Type::Custom)
, customColor(_color)
{
}
MessageColor::MessageColor(Type _type)
: type(_type)
{
}
const QColor &MessageColor::getColor(singletons::ThemeManager &themeManager) const
{
switch (this->type) {
case Type::Custom:
return this->customColor;
case Type::Text:
return themeManager.messages.textColors.regular;
case Type::System:
return themeManager.messages.textColors.system;
case Type::Link:
return themeManager.messages.textColors.link;
}
static QColor _default;
return _default;
}
} // namespace chatterino