mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
39 lines
729 B
C++
39 lines
729 B
C++
|
#include "messagecolor.h"
|
||
|
|
||
|
namespace chatterino {
|
||
|
namespace messages {
|
||
|
MessageColor::MessageColor(const QColor &color)
|
||
|
: type(Type::Custom)
|
||
|
, color(color)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
MessageColor::MessageColor(Type type)
|
||
|
: type(type)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|