mirror-chatterino2/colorscheme.h

96 lines
1.9 KiB
C
Raw Normal View History

2016-12-30 19:16:48 +01:00
#ifndef COLORSCHEME_H
#define COLORSCHEME_H
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-01-18 21:30:23 +01:00
namespace chatterino {
2016-12-30 19:16:48 +01:00
class ColorScheme
{
2016-12-30 20:41:24 +01:00
public:
bool IsLightTheme;
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];
2017-01-11 18:52:09 +01:00
static ColorScheme &
2017-01-24 20:15:12 +01:00
getInstance()
2016-12-30 20:41:24 +01:00
{
static ColorScheme instance;
return instance;
}
2017-02-02 01:23:26 +01:00
void init();
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-01-11 18:52:09 +01:00
ColorScheme()
2017-02-02 01:23:26 +01:00
: updated()
2017-01-11 18:52:09 +01:00
{
}
2017-01-18 01:04:54 +01:00
2017-02-02 01:23:26 +01:00
void setColors(float hue, float multiplyer);
2017-01-18 04:33:30 +01:00
qreal middleLookupTable[360] = {};
qreal minLookupTable[360] = {};
2017-01-18 01:04:54 +01:00
void fillLookupTableValues(qreal (&array)[360], qreal from, qreal to,
qreal fromValue, qreal toValue);
2016-12-30 19:16:48 +01:00
};
2017-01-18 21:30:23 +01:00
}
2016-12-30 19:16:48 +01:00
2017-01-11 18:52:09 +01:00
#endif // COLORSCHEME_H