mirror-chatterino2/src/messages/MessageColor.cpp
2018-07-06 19:24:35 +02:00

34 lines
720 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(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