2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
#include <QBrush>
|
2017-01-11 18:52:09 +01:00
|
|
|
#include <QColor>
|
2017-02-02 01:23:26 +01:00
|
|
|
#include <boost/signals2.hpp>
|
2017-07-02 12:36:50 +02:00
|
|
|
#include <pajlada/settings/setting.hpp>
|
2016-12-30 19:16:48 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-06-13 21:13:58 +02:00
|
|
|
class WindowManager;
|
|
|
|
|
2016-12-30 19:16:48 +01:00
|
|
|
class ColorScheme
|
|
|
|
{
|
2016-12-30 20:41:24 +01:00
|
|
|
public:
|
2017-06-26 16:41:20 +02:00
|
|
|
explicit ColorScheme(WindowManager &windowManager);
|
|
|
|
|
|
|
|
inline bool isLightTheme() const
|
|
|
|
{
|
|
|
|
return this->lightTheme;
|
|
|
|
}
|
2016-12-30 20:41:24 +01:00
|
|
|
|
2017-12-17 16:45:15 +01:00
|
|
|
static ColorScheme *instance;
|
|
|
|
|
2017-01-21 05:14:27 +01:00
|
|
|
QString InputStyleSheet;
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
QColor SystemMessageColor;
|
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
QColor DropPreviewBackground;
|
|
|
|
|
2016-12-30 20:41:24 +01:00
|
|
|
QColor TooltipBackground;
|
|
|
|
QColor TooltipText;
|
2017-08-17 14:52:41 +02:00
|
|
|
|
2016-12-30 20:41:24 +01:00
|
|
|
QColor ChatSeperator;
|
|
|
|
QColor ChatBackground;
|
|
|
|
QColor ChatBackgroundHighlighted;
|
|
|
|
QColor ChatBackgroundResub;
|
|
|
|
QColor ChatBackgroundWhisper;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
|
|
|
QColor ChatHeaderBorder;
|
|
|
|
QColor ChatHeaderBackground;
|
|
|
|
|
|
|
|
QColor ChatInputBackground;
|
2016-12-30 20:41:24 +01:00
|
|
|
QColor ChatInputBorder;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2016-12-30 20:41:24 +01:00
|
|
|
QColor ChatMessageSeperatorBorder;
|
|
|
|
QColor ChatMessageSeperatorBorderInner;
|
|
|
|
QColor ChatBorder;
|
|
|
|
QColor ChatBorderFocused;
|
|
|
|
QColor Text;
|
|
|
|
QColor TextCaret;
|
|
|
|
QColor TextLink;
|
|
|
|
QColor TextFocused;
|
|
|
|
QColor Menu;
|
|
|
|
QColor MenuBorder;
|
2017-08-05 18:15:23 +02:00
|
|
|
|
2016-12-30 20:41:24 +01:00
|
|
|
QColor ScrollbarBG;
|
|
|
|
QColor ScrollbarThumb;
|
|
|
|
QColor ScrollbarThumbSelected;
|
|
|
|
QColor ScrollbarArrow;
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-08-17 14:52:41 +02:00
|
|
|
QColor TabText;
|
2017-01-01 02:30:42 +01:00
|
|
|
QColor TabBackground;
|
2017-08-17 14:52:41 +02:00
|
|
|
|
|
|
|
QColor TabHoverText;
|
2017-01-01 02:30:42 +01:00
|
|
|
QColor TabHoverBackground;
|
2017-08-17 14:52:41 +02:00
|
|
|
|
|
|
|
QColor TabSelectedText;
|
2017-01-01 02:30:42 +01:00
|
|
|
QColor TabSelectedBackground;
|
2017-08-17 14:52:41 +02:00
|
|
|
|
|
|
|
QColor TabHighlightedText;
|
2017-01-01 02:30:42 +01:00
|
|
|
QColor TabHighlightedBackground;
|
2017-08-17 14:52:41 +02:00
|
|
|
|
2017-08-17 16:43:19 +02:00
|
|
|
QColor TabSelectedUnfocusedText;
|
|
|
|
QColor TabSelectedUnfocusedBackground;
|
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
QBrush TabNewMessageBackground;
|
2016-12-30 20:41:24 +01:00
|
|
|
|
2017-12-19 02:37:58 +01:00
|
|
|
QColor Selection;
|
|
|
|
|
2017-01-03 21:19:33 +01:00
|
|
|
const int HighlightColorCount = 3;
|
|
|
|
QColor HighlightColors[3];
|
|
|
|
|
2017-01-18 01:04:54 +01:00
|
|
|
void normalizeColor(QColor &color);
|
|
|
|
|
2017-02-02 01:23:26 +01:00
|
|
|
void update();
|
|
|
|
|
|
|
|
boost::signals2::signal<void()> updated;
|
2016-12-30 19:20:04 +01:00
|
|
|
|
|
|
|
private:
|
2017-07-02 12:36:50 +02:00
|
|
|
pajlada::Settings::Setting<std::string> themeName;
|
|
|
|
pajlada::Settings::Setting<double> themeHue;
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
void setColors(double hue, double multiplier);
|
2017-09-12 19:06:16 +02:00
|
|
|
QColor blendColors(const QColor &color1, const QColor &color2, qreal ratio);
|
2017-01-18 01:04:54 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
double middleLookupTable[360] = {};
|
|
|
|
double minLookupTable[360] = {};
|
2017-02-02 01:23:26 +01:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
void fillLookupTableValues(double (&array)[360], double from, double to, double fromValue,
|
|
|
|
double toValue);
|
2017-01-18 01:04:54 +01:00
|
|
|
|
2017-07-02 12:36:50 +02:00
|
|
|
bool lightTheme = false;
|
2016-12-30 19:16:48 +01:00
|
|
|
};
|
|
|
|
|
2017-06-07 10:09:24 +02:00
|
|
|
} // namespace chatterino
|