2017-09-21 12:15:01 +02:00
|
|
|
#include "messagecolor.hpp"
|
2017-09-21 00:54:10 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-09-21 12:15:01 +02:00
|
|
|
MessageColor::MessageColor(const QColor &_color)
|
2017-09-21 00:54:10 +02:00
|
|
|
: type(Type::Custom)
|
2017-09-21 12:15:01 +02:00
|
|
|
, color(_color)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
MessageColor::MessageColor(Type _type)
|
|
|
|
: type(_type)
|
2017-09-21 00:54:10 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageColor::Type MessageColor::getType() const
|
|
|
|
{
|
|
|
|
return this->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QColor &MessageColor::getColor(ColorScheme &colorScheme) const
|
|
|
|
{
|
|
|
|
switch (this->type) {
|
|
|
|
case Type::Custom:
|
|
|
|
return this->color;
|
|
|
|
case Type::Text:
|
|
|
|
return colorScheme.Text;
|
|
|
|
case Type::System:
|
|
|
|
return colorScheme.SystemMessageColor;
|
|
|
|
case Type::Link:
|
|
|
|
return colorScheme.TextLink;
|
|
|
|
}
|
|
|
|
|
|
|
|
static QColor _default;
|
|
|
|
return _default;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|