mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 13:38:28 -04:00
theme: large consolidation of colors into Theme.qml, add
surfaceContainerLow/Lowest
This commit is contained in:
+56
-40
@@ -463,6 +463,8 @@ Singleton {
|
||||
"background": getMatugenColor("background", "#1a1c1e"),
|
||||
"backgroundText": getMatugenColor("on_background", "#e3e8ef"),
|
||||
"outline": getMatugenColor("outline", "#8e918f"),
|
||||
"surfaceContainerLowest": getMatugenColor("surface_container_lowest", "#0e1013"),
|
||||
"surfaceContainerLow": getMatugenColor("surface_container_low", "#181a1d"),
|
||||
"surfaceContainer": getMatugenColor("surface_container", "#1e2023"),
|
||||
"surfaceContainerHigh": getMatugenColor("surface_container_high", "#292b2f"),
|
||||
"surfaceContainerHighest": getMatugenColor("surface_container_highest", "#343740"),
|
||||
@@ -535,7 +537,9 @@ Singleton {
|
||||
property color background: currentThemeData.background
|
||||
property color backgroundText: currentThemeData.backgroundText
|
||||
property color outline: currentThemeData.outline
|
||||
property color outlineVariant: currentThemeData.outlineVariant || Qt.rgba(outline.r, outline.g, outline.b, 0.6)
|
||||
property color outlineVariant: currentThemeData.outlineVariant || withAlpha(outline, 0.6)
|
||||
property color surfaceContainerLowest: currentThemeData.surfaceContainerLowest || blend(surfaceContainer, surface, 1.2)
|
||||
property color surfaceContainerLow: currentThemeData.surfaceContainerLow || blend(surface, surfaceContainer, 0.667)
|
||||
property color surfaceContainer: currentThemeData.surfaceContainer
|
||||
property color surfaceContainerHigh: currentThemeData.surfaceContainerHigh
|
||||
property color surfaceContainerHighest: currentThemeData.surfaceContainerHighest || surfaceContainerHigh
|
||||
@@ -546,9 +550,9 @@ Singleton {
|
||||
property color onSurface: surfaceText
|
||||
property color onSurfaceVariant: surfaceVariantText
|
||||
property color onPrimary: primaryText
|
||||
property color onSurface_12: Qt.rgba(onSurface.r, onSurface.g, onSurface.b, 0.12)
|
||||
property color onSurface_38: Qt.rgba(onSurface.r, onSurface.g, onSurface.b, 0.38)
|
||||
property color onSurfaceVariant_30: Qt.rgba(onSurfaceVariant.r, onSurfaceVariant.g, onSurfaceVariant.b, 0.30)
|
||||
property color onSurface_12: withAlpha(onSurface, 0.12)
|
||||
property color onSurface_38: withAlpha(onSurface, 0.38)
|
||||
property color onSurfaceVariant_30: withAlpha(onSurfaceVariant, 0.30)
|
||||
|
||||
property color error: currentThemeData.error || "#F2B8B5"
|
||||
property color warning: currentThemeData.warning || "#FF9800"
|
||||
@@ -557,32 +561,32 @@ Singleton {
|
||||
property color tempDanger: "#ff5555"
|
||||
property color success: currentThemeData.success || "#4CAF50"
|
||||
|
||||
property color primaryHover: Qt.rgba(primary.r, primary.g, primary.b, 0.12)
|
||||
property color primaryHoverLight: Qt.rgba(primary.r, primary.g, primary.b, transparentBlurLayers ? 0.12 : 0.08)
|
||||
property color primaryPressed: Qt.rgba(primary.r, primary.g, primary.b, transparentBlurLayers ? 0.24 : 0.16)
|
||||
property color primarySelected: Qt.rgba(primary.r, primary.g, primary.b, 0.3)
|
||||
property color primaryBackground: Qt.rgba(primary.r, primary.g, primary.b, 0.04)
|
||||
property color primaryHover: withAlpha(primary, 0.12)
|
||||
property color primaryHoverLight: withAlpha(primary, transparentBlurLayers ? 0.12 : 0.08)
|
||||
property color primaryPressed: withAlpha(primary, transparentBlurLayers ? 0.24 : 0.16)
|
||||
property color primarySelected: withAlpha(primary, 0.3)
|
||||
property color primaryBackground: withAlpha(primary, 0.04)
|
||||
|
||||
property color secondaryHover: Qt.rgba(secondary.r, secondary.g, secondary.b, 0.08)
|
||||
property color secondaryHover: withAlpha(secondary, 0.08)
|
||||
|
||||
property color surfaceHover: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.08)
|
||||
property color surfacePressed: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.12)
|
||||
property color surfaceSelected: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.15)
|
||||
property color surfaceLight: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, transparentBlurLayers ? 0.3 : 0.1)
|
||||
property color surfaceVariantAlpha: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.2)
|
||||
property color surfaceHover: withAlpha(surfaceVariant, 0.08)
|
||||
property color surfacePressed: withAlpha(surfaceVariant, 0.12)
|
||||
property color surfaceSelected: withAlpha(surfaceVariant, 0.15)
|
||||
property color surfaceLight: withAlpha(surfaceVariant, transparentBlurLayers ? 0.3 : 0.1)
|
||||
property color surfaceVariantAlpha: withAlpha(surfaceVariant, 0.2)
|
||||
|
||||
readonly property bool blurForegroundLayers: BlurService.enabled && (typeof SettingsData === "undefined" || (SettingsData.blurForegroundLayers ?? true))
|
||||
readonly property bool transparentBlurLayers: BlurService.enabled && !blurForegroundLayers
|
||||
readonly property color readableSurface: withAlpha(surfaceContainer, popupTransparency)
|
||||
readonly property color readableSurfaceHigh: withAlpha(surfaceContainerHigh, popupTransparency)
|
||||
readonly property color floatingSurface: transparentBlurLayers ? "transparent" : readableSurface
|
||||
readonly property color floatingSurfaceHigh: transparentBlurLayers ? "transparent" : readableSurfaceHigh
|
||||
readonly property color floatingSurface: transparentBlurLayers ? withAlpha(readableSurface, 0) : readableSurface
|
||||
readonly property color floatingSurfaceHigh: transparentBlurLayers ? withAlpha(readableSurfaceHigh, 0) : readableSurfaceHigh
|
||||
readonly property color nestedSurface: floatingSurfaceHigh
|
||||
readonly property real blurLayerOutlineOpacity: Math.max(0, Math.min(1, typeof SettingsData === "undefined" ? 0.12 : (SettingsData.blurLayerOutlineOpacity ?? 0.12)))
|
||||
readonly property real layerOutlineOpacity: BlurService.enabled ? blurLayerOutlineOpacity : 0.08
|
||||
readonly property int layerOutlineWidth: BlurService.enabled && layerOutlineOpacity > 0 ? 1 : 0
|
||||
property color surfaceTextHover: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.08)
|
||||
property color surfaceTextAlpha: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.3)
|
||||
property color surfaceTextHover: withAlpha(surfaceText, 0.08)
|
||||
property color surfaceTextAlpha: withAlpha(surfaceText, 0.3)
|
||||
|
||||
function roleColor(mode) {
|
||||
switch (mode) {
|
||||
@@ -607,6 +611,10 @@ Singleton {
|
||||
return surfaceVariant;
|
||||
case "s":
|
||||
return surface;
|
||||
case "scll":
|
||||
return surfaceContainerLowest;
|
||||
case "scl":
|
||||
return surfaceContainerLow;
|
||||
case "sc":
|
||||
return surfaceContainer;
|
||||
case "sch":
|
||||
@@ -619,19 +627,23 @@ Singleton {
|
||||
case "err":
|
||||
return error;
|
||||
default:
|
||||
return "transparent";
|
||||
return withAlpha(surface, 0);
|
||||
}
|
||||
}
|
||||
property color surfaceTextLight: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.06)
|
||||
property color surfaceTextMedium: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.7)
|
||||
property color surfaceTextLight: withAlpha(surfaceText, 0.06)
|
||||
property color surfaceTextSecondary: withAlpha(surfaceText, 0.6)
|
||||
property color surfaceTextMedium: withAlpha(surfaceText, 0.7)
|
||||
|
||||
property color outlineButton: Qt.rgba(outline.r, outline.g, outline.b, 0.5)
|
||||
property color outlineLight: Qt.rgba(outline.r, outline.g, outline.b, BlurService.enabled ? Math.min(1, layerOutlineOpacity * 0.625) : 0.05)
|
||||
property color outlineMedium: Qt.rgba(outline.r, outline.g, outline.b, layerOutlineOpacity)
|
||||
property color outlineStrong: Qt.rgba(outline.r, outline.g, outline.b, BlurService.enabled ? Math.min(1, layerOutlineOpacity * 1.5) : 0.12)
|
||||
property color outlineButton: withAlpha(outline, 0.5)
|
||||
property color outlineLight: withAlpha(outline, BlurService.enabled ? Math.min(1, layerOutlineOpacity * 0.625) : 0.05)
|
||||
property color outlineMedium: withAlpha(outline, layerOutlineOpacity)
|
||||
property color outlineStrong: withAlpha(outline, BlurService.enabled ? Math.min(1, layerOutlineOpacity * 1.5) : 0.12)
|
||||
property color outlineHeavy: withAlpha(outline, 0.2)
|
||||
|
||||
property color errorHover: Qt.rgba(error.r, error.g, error.b, 0.12)
|
||||
property color errorPressed: Qt.rgba(error.r, error.g, error.b, 0.16)
|
||||
property color errorHover: withAlpha(error, 0.12)
|
||||
property color errorPressed: withAlpha(error, 0.16)
|
||||
property color errorSelected: withAlpha(error, 0.3)
|
||||
property color warningHover: withAlpha(warning, 0.12)
|
||||
|
||||
readonly property color ccTileActiveBg: {
|
||||
switch (SettingsData.controlCenterTileColorMode) {
|
||||
@@ -681,13 +693,13 @@ Singleton {
|
||||
readonly property color ccTileRing: {
|
||||
switch (SettingsData.controlCenterTileColorMode) {
|
||||
case "primaryContainer":
|
||||
return Qt.rgba(primary.r, primary.g, primary.b, 0.22);
|
||||
return withAlpha(primary, 0.22);
|
||||
case "secondary":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.22);
|
||||
return withAlpha(surfaceText, 0.22);
|
||||
case "surfaceVariant":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.22);
|
||||
return withAlpha(surfaceText, 0.22);
|
||||
default:
|
||||
return Qt.rgba(primaryText.r, primaryText.g, primaryText.b, 0.22);
|
||||
return withAlpha(primaryText, 0.22);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -720,11 +732,11 @@ Singleton {
|
||||
readonly property color buttonHover: {
|
||||
switch (SettingsData.buttonColorMode) {
|
||||
case "primaryContainer":
|
||||
return Qt.rgba(primary.r, primary.g, primary.b, 0.12);
|
||||
return withAlpha(primary, 0.12);
|
||||
case "secondary":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.12);
|
||||
return withAlpha(surfaceText, 0.12);
|
||||
case "surfaceVariant":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.12);
|
||||
return withAlpha(surfaceText, 0.12);
|
||||
default:
|
||||
return primaryHover;
|
||||
}
|
||||
@@ -733,11 +745,11 @@ Singleton {
|
||||
readonly property color buttonPressed: {
|
||||
switch (SettingsData.buttonColorMode) {
|
||||
case "primaryContainer":
|
||||
return Qt.rgba(primary.r, primary.g, primary.b, 0.16);
|
||||
return withAlpha(primary, 0.16);
|
||||
case "secondary":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.16);
|
||||
return withAlpha(surfaceText, 0.16);
|
||||
case "surfaceVariant":
|
||||
return Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.16);
|
||||
return withAlpha(surfaceText, 0.16);
|
||||
default:
|
||||
return primaryPressed;
|
||||
}
|
||||
@@ -1068,7 +1080,7 @@ Singleton {
|
||||
readonly property color connectedSurfaceColor: {
|
||||
if (typeof SettingsData === "undefined")
|
||||
return withAlpha(surfaceContainer, popupTransparency);
|
||||
return isConnectedEffect ? Qt.rgba(SettingsData.effectiveFrameColor.r, SettingsData.effectiveFrameColor.g, SettingsData.effectiveFrameColor.b, SettingsData.frameOpacity) : withAlpha(surfaceContainer, popupTransparency);
|
||||
return isConnectedEffect ? withAlpha(SettingsData.effectiveFrameColor, SettingsData.frameOpacity) : withAlpha(surfaceContainer, popupTransparency);
|
||||
}
|
||||
readonly property real connectedSurfaceRadius: isConnectedEffect ? connectedCornerRadius : cornerRadius
|
||||
readonly property bool connectedSurfaceBlurEnabled: (typeof SettingsData === "undefined") ? true : (!isConnectedEffect || SettingsData.frameBlurEnabled)
|
||||
@@ -1468,7 +1480,7 @@ Singleton {
|
||||
property string currentThemeName: currentTheme
|
||||
|
||||
function panelBackground() {
|
||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, panelTransparency);
|
||||
return withAlpha(surfaceContainer, panelTransparency);
|
||||
}
|
||||
|
||||
property real notepadTransparency: SettingsData.notepadTransparencyOverride >= 0 ? SettingsData.notepadTransparencyOverride : popupTransparency
|
||||
@@ -1978,6 +1990,8 @@ Singleton {
|
||||
}
|
||||
|
||||
function withAlpha(c, a) {
|
||||
if (!c || c.r === undefined)
|
||||
return Qt.rgba(0, 0, 0, 0);
|
||||
return Qt.rgba(c.r, c.g, c.b, a);
|
||||
}
|
||||
|
||||
@@ -1988,6 +2002,8 @@ Singleton {
|
||||
}
|
||||
|
||||
function blendAlpha(c, a) {
|
||||
if (!c || c.r === undefined)
|
||||
return Qt.rgba(0, 0, 0, 0);
|
||||
return Qt.rgba(c.r, c.g, c.b, c.a * a);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user