Help building a custom battery indicator

I’ve been trying to create a custom battery indicator style. I used Fett263’s style library as a base to try and understand how it works. I took what I thought to be the battery indicator part of the code and tried to turn it into a singular style:

StylePtr<TransitionEffectL<TrConcat<TrJoin<TrDelay<2000>,TrWipe<1000>>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>()

However compiling the code returns this error:

could not convert '((StyleHelper<RGBA_nod>*)this)->StyleHelper<RGBA_nod>::getColor2(i)' from 'RGBA_nod' to 'OverDriveColor'

and I’m a bit confused as to what this means exactly.

You can’t have a transparent layer like TransitionEffectL<> as a base layer, it needs to be a solid color. I would just do:

StylePtr<Layers<Black,YOUR_TRANSITION_LAYER>>()

I wasn’t aware there were transparent and non-transparent layers. Is this documented somewhere?

Yes, anything that ends in an “L” is a transparent layer, so it can’t be the Base layer of a style (first color). Can’t recall where it’s documented, Layers<> have been around for years.

Also, a solid color can’t go on top of another solid color.
So essentially the rule of thumb is base layer solid (a non-L layer), everything else on top of that is a transparent layer.

What about effects? I can’t seem to find where they are defined in the code. I can infer some of them by name (i.e. EFFECT_BLAST is triggered when the blast button is pressed) but some of them I’m not sure. For instance what triggers EFFECT_BATTERY_LEVEL?

The prop file would have a button event that triggers that.