# Relational Operators [Solved]

Ok, so i’m in the middle of setting up a background that i only want to change opacity during the day. 50% at 6-10am, 100% at 10-2pm and 50% from 2pm-7, 0% the rest of the time. I can get it to show at 6am but i cant make it dissapear at 7pm…

I’m in the opacity settings and my guess is that it’d be something like,

16.6*[H] (16.6/[H]>=17)
or
(([H]>=12)*5) (([H]>=12)/5)

Or should i just dbl layer and reverse the process?

Hello,
you would have to add the background twice, one of them set with 50% opacity another with 100% and set when they appear on the time line.
Or chain up all the conditions in one expression, like this:
`(([H]>=6)*([H]<10)+([H]>=14)*([H]<19))*50+([H]>=10)*([H]<14)*100`
in expressions work just with the numbers of percent. do not use sign % unless you want to use it as “modulo” operator.

1 Like

Thats exactly what i was looking for.

Could you please explain what this means? and how you got to this?

in each pair of brackets is one condition. If the result is true, it equals 1, if its false it equals 0.
they are paired in (start of period)times(end of period)times desired value.
so only if its after start and before end, it gives `1*1*50` for example. it would also make some true results even in other conditions, but since they are paired those would result in like `0*1*100`
also note that [H] has values from 0 to 23 so the border times have to be put in 24h format.

at 5AM, none of conditions is met so opacity will remain 0.
at 7AM, both conditions in first pair are met while only one of other pairs, so there will be
`((1*1)+(0*1))*50+0*1*100` which result is 50

1 Like

Thank you for explaining that, i’m gonna study this until i fully get it, but this is pretty clear definition.

Again, thanks for the time ^^,