Conditional opacity depending on position of the sun

Dear watchface hackers :slight_smile:
I would like to display an image only after sunset AND before sunrise.
I tried to cobble together an expression that SHOULD do this, but it doesn’t work, the image is displayed all the time.
Can you spot the error? My possibilities are exhausted. Did I fumble the brackets?

$
(
((#DH#*60+#Dm#)>=((#WSH#*60)+#WSm#))
||
((#DH#*60+#Dm#)<((#WRH#*60)+#WRm#))
)
?100:0
$

1 Like

Ha! I fumbled the brackets. FWIW, here’s the functioning expression:

$
(#DH#*60+#Dm#)>=((#WSH#*60)+#WSm#)
||
(#DH#*60+#Dm#)<((#WRH#*60)+#WRm#)
?100:0
$

2 Likes

Hello,
I think it would be easier to use this tag, which however has reputation not being reliable on some watches, but maybe still worth trying
image
opacity should the be like $#DISDAYTIME#?0:100$

4 Likes

Exactly what I thought straight away @petruuccios my friend :joy: :+1:

2 Likes

Yes, thanks! I completely and utterly overlooked this handy Tag!

2 Likes