mirror-chatterino2/src/messages/MessageColor.cpp
2018-10-21 13:43:02 +02:00

36 lines
757 B
C++

#include "MessageColor.hpp"
#include "singletons/Theme.hpp"
namespace chatterino {
MessageColor::MessageColor(const QColor &color)
: type_(Type::Custom)
, customColor_(color)
{
}
MessageColor::MessageColor(Type type)
: type_(type)
{
}
const QColor &MessageColor::getColor(Theme &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