mirror-chatterino2/src/messages/MessageColor.cpp

34 lines
720 B
C++
Raw Normal View History

2018-06-26 14:09:39 +02:00
#include "MessageColor.hpp"
namespace chatterino {
2017-09-21 12:15:01 +02:00
MessageColor::MessageColor(const QColor &_color)
: type(Type::Custom)
2018-01-28 03:57:22 +01:00
, customColor(_color)
{
}
2017-09-21 12:15:01 +02:00
MessageColor::MessageColor(Type _type)
: type(_type)
{
}
2018-06-28 19:51:07 +02:00
const QColor &MessageColor::getColor(Themes &themeManager) const
{
switch (this->type) {
case Type::Custom:
2018-01-28 03:57:22 +01:00
return this->customColor;
case Type::Text:
2018-01-02 02:15:11 +01:00
return themeManager.messages.textColors.regular;
case Type::System:
2018-01-02 02:15:11 +01:00
return themeManager.messages.textColors.system;
case Type::Link:
2018-01-02 02:15:11 +01:00
return themeManager.messages.textColors.link;
}
static QColor _default;
return _default;
}
2017-12-16 17:53:48 +01:00
} // namespace chatterino