1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-13 14:36:32 -04:00

Refactor shadow handling & improve connected chrome rendering

This commit is contained in:
purian23
2026-06-10 09:34:42 -04:00
parent f8b32cc298
commit e95c80011f
20 changed files with 434 additions and 618 deletions
+13
View File
@@ -911,6 +911,19 @@ Singleton {
}
return Qt.rgba(r, g, b, alpha);
}
// Non-directional ambient layer of the M3 two-part shadow model (key +
// ambient). Derived from the key level so user intensity/opacity settings
// scale both layers together.
function elevationAmbient(level) {
const blur = (level && level.blurPx !== undefined) ? Math.max(0, level.blurPx) : 0;
const alpha = ((level && level.alpha !== undefined) ? level.alpha : 0.3) * 0.5;
return {
blurPx: blur * 1.75,
spreadPx: 1,
alpha: alpha
};
}
function elevationTintOpacity(level) {
if (!level)
return 0;