mirror-chatterino2/src/colorscheme.hpp

90 lines
1.9 KiB
C++
Raw Normal View History

#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>
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
class WindowManager;
2016-12-30 19:16:48 +01:00
class ColorScheme
{
2016-12-30 20:41:24 +01:00
public:
explicit ColorScheme(WindowManager &windowManager);
inline bool isLightTheme() const
{
return this->lightTheme;
}
2016-12-30 20:41:24 +01:00
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;
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;
QColor ScrollbarBG;
QColor ScrollbarThumb;
QColor ScrollbarThumbSelected;
QColor ScrollbarArrow;
2017-01-01 02:30:42 +01:00
QColor TabPanelBackground;
QColor TabBackground;
QColor TabHoverBackground;
QColor TabSelectedBackground;
QColor TabHighlightedBackground;
QBrush TabNewMessageBackground;
2016-12-30 20:41:24 +01:00
QColor TabText;
QColor TabHoverText;
QColor TabSelectedText;
QColor TabHighlightedText;
2017-01-03 21:19:33 +01:00
const int HighlightColorCount = 3;
QColor HighlightColors[3];
void init(WindowManager &windowManager);
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:
void setColors(double hue, double multiplier);
2017-01-18 01:04:54 +01:00
double middleLookupTable[360] = {};
double minLookupTable[360] = {};
2017-02-02 01:23:26 +01:00
void fillLookupTableValues(double (&array)[360], double from, double to, double fromValue,
double toValue);
2017-01-18 01:04:54 +01:00
bool lightTheme;
2016-12-30 19:16:48 +01:00
};
} // namespace chatterino