FACER Community

I'm looking for an unusual code again

I’m looking for an unusual code again.
I want to create 16 fields.
These 16 fields are intended to show the batt status in stages.
That would actually be relatively easy.

now comes the hard part…
I don’t just want to turn it on and off, I want to dim it.
So link visibility to battery level.

who has a suitable idea for this?

For example, my watch face TX-CR112 does this with 5 circles, opacity settings:

1st: $#BLN#>=2?(#BLN#*5):0$
2nd:$#BLN#>=20?(#BLN#*2.5):0$
3rd:$#BLN#>=40?(#BLN#*1.66):0$
4th:$#BLN#>=60?(#BLN#*1.25):0$
5th:$#BLN#>=80?#BLN#:0$

I can’t see it clearly.
the dimming itself is not directly linked to the batt state, well?

Thank you for your help

It is linked to the battery level.

At 100% all circles are at 100 opacity.
The battery level goes down, the the 5th circle gets dimmer, once battery is below 80, opacity is 0. And so on.

I’ve opened up Inspection Mode. Have a look…

would you be so kind as to explain the code to me please?
I don’t learn everything just by copying.

ok.
Take the 1st circle. I want it to dim between level 2 and level 20 of the battery (could also be 0-20). So the condition should be: if BLN bigger 2, then show a dimmed value. Below 2, value is 0.

At level 20 it should have opacity 100, so I need the opacity to be 5x20. If the battery level is 21, obviously, the formula will have opacity 5x21, but I don’t care. In the opacity field anything bigger 100 will be the same as 100.

The 2nd circle, I want it to dim between 20-40, so at level 40, the opacity needs to be 100, so BLNx2.5.

and so on, hope I made some sense …

I understand that

but how do I calculate the * value?
if i want to use 16 fields, i have to use different values.

Ah, I think I understand

100% visibility : batt % = * value

ah yes, then each circle will be a factor of 16.
So first one would between 0-6.25. BLNx100/6.25 (or BLNx16)

Second one is 6.25-12.5, BLNx100/12.5

Third one 12.5-18.75, BLNx100/18.75

Forth one 18.75-25, BLN*100/25

I just ask myself one question…
the dimming is evenly distributed among all, right?
i.e. the dimming is always calculated from the entire 100% of the battery…

So I have no real dimming only from the sub-area

Batt Part Display 80-100% Batt
smooth dimming from 100-0% visibility

at 90% batt the visibility should be 50%
at 85% batt = visibility 25%

yes, correct, if you want non linear dimming, then the math becomes more complicated, probably logrithmic or something

the precise calculation of the partial areas would therefore be too complex and imprecise

I understand

thank you for your help and your patience