From 87eec4a51ef096e190b4a96ee4d2c86390ac752d Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 14 Jan 2026 12:11:33 +0100 Subject: [PATCH] updated --- glance-system/glance-kisfenyo.yaml | 44 ++++++++++++++++-------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index d62c8ee..9fd2a65 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -387,7 +387,7 @@ data: color_yellow: "#F0F046" color_blue: "#46F0F0" color_white: "#FFFFFF" - overlay_color: "rgba(0,0,0,0.35)" + overlay_color: "rgba(255,0,255,0.35)" template: | {{/* Weather widget – fully customizable via options */}} {{ $temp_unit := .Options.StringOr "temp_unit" "celsius" }} @@ -534,26 +534,28 @@ data: {{ $thisHighPct := sub 1 (div (sub $max_max $thisHigh) $temp_range) }} {{ $thisLowPct := div (sub $thisLow $min_min) $temp_range }} {{ $thisTempRange := sub $thisHigh $thisLow }} - {{ $red_pos := mul 100 (div (sub $thisHigh $temp_red) $thisTempRange) | toInt }} - {{ $yel_pos := mul 100 (div (sub $thisHigh $temp_yellow) $thisTempRange) | toInt }} - {{ $blu_pos := mul 100 (div (sub $thisHigh $temp_blue) $thisTempRange) | toInt }} - {{ $whi_pos := mul 100 (div (sub $thisHigh $temp_white) $thisTempRange) | toInt }} - {{ $gradient_string := printf "%s %d%%, %s %d%%, %s %d%%, %s %d%%" $color_red $red_pos $color_yellow $yel_pos $color_blue $blu_pos $color_white $whi_pos }} -
- {{ $top_pos := -2 }} - {{ $bot_pos := -2 }} - {{ $pos_thresh := 0.20 }} - {{ if lt (div $thisTempRange $temp_range) $pos_thresh }} - {{ $top_pos = -17 }} - {{ $bot_pos = -19 }} - {{ else if and (lt (div $thisTempRange $temp_range) (mul $pos_thresh 2)) (lt (sub 1 $thisHighPct) $thisLowPct) }} - {{ $bot_pos = -19 }} - {{ else if and (lt (div $thisTempRange $temp_range) (mul $pos_thresh 2)) (gt (sub 1 $thisHighPct) $thisLowPct) }} - {{ $top_pos = -17 }} - {{ end }} -
+ {{/* Clamp helper (no clamp() function in Glance templates) */}} + {{ $pRed := $red_pos }}{{ if lt $pRed 0 }}{{ $pRed = 0 }}{{ end }}{{ if gt $pRed 100 }}{{ $pRed = 100 }}{{ end }} + {{ $pYel := $yel_pos }}{{ if lt $pYel 0 }}{{ $pYel = 0 }}{{ end }}{{ if gt $pYel 100 }}{{ $pYel = 100 }}{{ end }} + {{ $pBlu := $blu_pos }}{{ if lt $pBlu 0 }}{{ $pBlu = 0 }}{{ end }}{{ if gt $pBlu 100 }}{{ $pBlu = 100 }}{{ end }} + {{ $pWhi := $whi_pos }}{{ if lt $pWhi 0 }}{{ $pWhi = 0 }}{{ end }}{{ if gt $pWhi 100 }}{{ $pWhi = 100 }}{{ end }} + {{/* Make sure stops are non-decreasing (simple ordering guard) */}} + {{ if lt $pYel $pRed }}{{ $pYel = $pRed }}{{ end }} + {{ if lt $pBlu $pYel }}{{ $pBlu = $pYel }}{{ end }} + {{ if lt $pWhi $pBlu }}{{ $pWhi = $pBlu }}{{ end }} +
+ {{/* “Gradient” as 4 stacked color bands */}} +
+
+
+
+
+
+ {{/* Overlay for the numbers (keep it transparent-ish) */}} +

{{ $thisHigh | toInt }}

{{ $thisLow | toInt }}