improve outline color calculations

pull/5/head
Michail Vourlakos 6 years ago
parent a314516379
commit 14417a69f1

@ -41,3 +41,8 @@ function colorLuminasFromRGB(r, g, b) {
return 0.2126*rS + 0.7152*gS + 0.0722*bS;
}
function normalize(min, max, per) {
return min + ((max-min) * per);
}

@ -37,7 +37,20 @@ Loader{
readonly property real themeTextColorBrightness: ColorizerTools.colorBrightness(textColor)
readonly property real backgroundColorBrightness: ColorizerTools.colorBrightness(backgroundColor)
readonly property color minimizedDotColor: themeTextColorBrightness > 127.5 ? Qt.darker(textColor, 1.7) : Qt.lighter(textColor, 8)
readonly property color outlineColor: backgroundColorBrightness > 127.5 ? Qt.darker(backgroundColor, 1.5) : Qt.lighter(backgroundColor, 3.3)
readonly property color outlineColorBase: backgroundColor
readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase)
readonly property color outlineColor: {
if (!root.panelOutline) {
return backgroundColor;
}
if (outlineColorBaseBrightness > 127.5) {
return Qt.darker(outlineColorBase, 1.5);
} else {
return Qt.lighter(outlineColorBase, 2.2);
}
}
readonly property bool mustBeShown: (applyTheme && applyTheme !== theme)

Loading…
Cancel
Save