mirror-chatterino2/colorscheme.cpp

19 lines
517 B
C++
Raw Normal View History

2016-12-30 19:20:04 +01:00
#include "QColor"
2016-12-30 19:16:48 +01:00
#include "colorscheme.h"
2016-12-30 19:20:04 +01:00
// hue: theme color (0 - 1)
// multiplyer: 1 = white, 0.8 = light, -0.8 dark, -1 black
void ColorScheme::makeScheme(float hue, float multiplyer)
2016-12-30 19:16:48 +01:00
{
2016-12-30 19:20:04 +01:00
IsLightTheme = multiplyer > 0;
2016-12-30 19:16:48 +01:00
2016-12-30 19:20:04 +01:00
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()
2016-12-30 19:16:48 +01:00
}