mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
34 lines
720 B
C++
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
|