Calc function
#1
I would love to have a CALC / Formula type control(s) similar to rainmeter for skin

https://docs.rainmeter.net/manual-beta/formulas/

Just off the top of my head a progress control that could for example use something similar to the following code I wrote to change the bar color dynamically from red to green with a pseudo graduation of yellow and orange along the way...

Image
(example of 3 random graph/progress color states)

*this is rainmeter code used as an example of what I would LOVE to see become possible for Kodi skins*

Code:
[MeasureL]
UpdateRate=5
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS
IfCondition=(MeasureL * 100) > 0 && ((MeasureL * 100) >= 50)
IfTrueAction=[!SetOption GraphL PrimaryColor "255,[*MeasureGreenLeft*],0,255"] [!UpdateMeter GraphL] [!Redraw]
IfCondition2=(MeasureL * 100) > 0 && ((MeasureL * 100) < 50)
IfTrueAction2=[!SetOption GraphL PrimaryColor "[*MeasureRedLeft*],255,0,255"] [!UpdateMeter GraphL] [!Redraw]
DynamicVariables=1
OnChangeAction=[!UpdateMeter GraphL] [!Redraw]
OnUpdateAction=[!UpdateMeter GraphL] [!Redraw]

[MeasureR]
UpdateRate=5
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=R
Type=RMS
IfCondition=(MeasureR * 100) > 0 && ((MeasureR * 100) >= 50)
IfTrueAction=[!SetOption GraphR PrimaryColor "255,[*MeasureGreenRight*],0,255"] [!UpdateMeter GraphR] [!Redraw]
IfCondition2=(MeasureR * 100) > 0 && ((MeasureR * 100) < 50)
IfTrueAction2=[!SetOption GraphR PrimaryColor "[*MeasureRedRight*],255,0,255"] [!UpdateMeter GraphR] [!Redraw]
DynamicVariables=1
OnChangeAction=[!UpdateMeter GraphR] [!Redraw]
OnUpdateAction=[!UpdateMeter GraphR] [!Redraw]

[MeasureGreenRight]
UpdateRate=5
Measure=Calc
Formula=Clamp(255 - Trunc((255*((MeasureR * 100) - 50) / 50)),0,255)

[MeasureRedRight]
UpdateRate=5
Measure=Calc
Formula=Clamp(Trunc((255 * (MeasureR * 100) / 50)),0,255)

[MeasureGreenLeft]
UpdateRate=5
Measure=Calc
Formula=Clamp(255 - Trunc((255*((MeasureL * 100) - 50) / 50)),0,255)

[MeasureRedLeft]
UpdateRate=5
Measure=Calc
Formula=Clamp(Trunc((255 * (MeasureL * 100) / 50)),0,255)

[MeasurePercentRight]
UpdateRate=100
Measure=Calc
Formula=Clamp(Trunc((MeasureR * 100)),0,100)

[MeasurePercentLeft]
UpdateRate=100
Measure=Calc
Formula=Clamp(Trunc((MeasureL * 100)),0,100)
Reply

Logout Mark Read Team Forum Stats Members Help
Calc function0