added basic colorscheme

This commit is contained in:
fourtf 2016-12-30 20:41:24 +01:00
parent 11e3600770
commit a175c0a54c
2 changed files with 47 additions and 42 deletions

View file

@ -3,16 +3,18 @@
// hue: theme color (0 - 1)
// multiplyer: 1 = white, 0.8 = light, -0.8 dark, -1 black
void ColorScheme::makeScheme(float hue, float multiplyer)
void ColorScheme::setColors(float hue, float multiplyer)
{
IsLightTheme = multiplyer > 0;
auto getColor = [IsLightTheme, multiplyer] (qreal h, qreal s, qreal l) -> QColor
auto isLightTheme = IsLightTheme;
auto getColor = [isLightTheme, multiplyer] (qreal h, qreal s, qreal l) -> QColor
{
return QColor::fromHslF(h, s, (((l - 0.5) * multiplyer) + 0.5));
};
TextCaret = IsLightTheme ? QColor(0, 0, 0) : QColor(255, 255, 255);
//ChatBorder = IsLightTheme ? QColor()
// ChatBorder = IsLightTheme ? QColor()
}

View file

@ -5,49 +5,52 @@
class ColorScheme
{
static bool IsLightTheme;
public:
bool IsLightTheme;
static QColor TooltipBackground;
static QColor TooltipText;
QColor TooltipBackground;
QColor TooltipText;
QColor ChatSeperator;
QColor ChatBackground;
QColor ChatBackgroundHighlighted;
QColor ChatBackgroundResub;
QColor ChatBackgroundWhisper;
QColor ChatInputOuter;
QColor ChatInputInner;
QColor ChatInputBorder;
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;
QColor TabPanelBG;
QColor TabBG;
QColor TabHoverBG;
QColor TabSelectedBG;
QColor TabHighlightedBG;
QColor TabNewMessageBG;
QColor TabText;
QColor TabHoverText;
QColor TabSelectedText;
QColor TabHighlightedText;
static QColor ChatSeperator;
static QColor ChatBackground;
static QColor ChatBackgroundHighlighted;
static QColor ChatBackgroundResub;
static QColor ChatBackgroundWhisper;
static QColor ChatInputOuter;
static QColor ChatInputInner;
static QColor ChatInputBorder;
static QColor ChatMessageSeperatorBorder;
static QColor ChatMessageSeperatorBorderInner;
static QColor ChatBorder;
static QColor ChatBorderFocused;
static ColorScheme& getInstance()
{
static ColorScheme instance;
static QColor Text;
static QColor TextCaret;
static QColor TextLink;
static QColor TextFocused;
return instance;
}
static QColor Menu;
static QColor MenuBorder;
static QColor ScrollbarBG;
static QColor ScrollbarThumb;
static QColor ScrollbarThumbSelected;
static QColor ScrollbarArrow;
static QColor TabPanelBG;
static QColor TabBG;
static QColor TabHoverBG;
static QColor TabSelectedBG;
static QColor TabHighlightedBG;
static QColor TabNewMessageBG;
static QColor TabText;
static QColor TabHoverText;
static QColor TabSelectedText;
static QColor TabHighlightedText;
static void makeScheme(float hue, float multiplyer);
void setColors(float hue, float multiplyer);
private:
ColorScheme() {}