Help with conditional opacity

I am looking to have a conditional opacity that will both dim at night time and on non-active days of the week
and also another that is 100% on active the active day of week and during daylight hours.

Can anyone help with this?

Here are the expressions I normally use, is there a way to combine these?
Day of Week:
$#DOWB#=5?80:0$
DayLight:
$#Dk#>=#WSUNRISEH24#&&#Dk#<=#WSUNSETH24#?100:0$
Night:
$(#DH#+(#Dm#/60))>(#WRH#+(#WRm#/60))&&(#DH#+(#Dm#/60))<(#WSH#+(#WSm#/60))?0:100$

You could duplicate the layer and set conditions for each.

The first being to dim on non-active days.

The second being to dim during night.

The trick would be to change the opacity on the first layer (non-active days) to what you want it to be. So, transparency is set to 80, no formula. Instead, you change the X position field and use the formula there. So, it’d be $#DOWB#=5?160:-160$ Meaning if it’s the 5th day of the week, it’ll be in the center of the watch and 80% opacity. Otherwise, it goes off the watchface (-160)

With the day eliminated as a problem, you can focus on the Day/Night cycle.

I haven’t used WSUNRISE/SUNSET so I can’t comment there. Here’s the formulas I’ve used in the past which may be outdated.

Transparent during day
$(#DH#)<(#WSH#)&&(#DH#)>(#WRH#)?0:100$

Transparent during night
$(#DH#)<(#WSH#)&&(#DH#)>(#WRH#)?100:0$

Either way, combining multiple boolean conditions is tough if not impossible. You can cascade testing for something (IE: If DOWB=1 set to 10% opacity else if DOWB=2 set to 10%… etc… If DOWB=7 set to 100% but you can’t say If it’s Tuesday and greater than 80 degrees do something. A lot of people have used another field as a way to get around the limitations. (IE: Check for daylight hours in transparency and check for day of week in the X position field)

Hopefully this helps and isn’t too confusing.

1 Like

I get what you’re saying, appreciate the idea! For now I did a workaround that put a layer of color over them at night!

The formula I use with WSUNRISEH24/WSUNSETH24 changes at the hour and minute of SUNRISE/SUNSET with the H24 using a 24Hour military time rather than 12H.