+1-ing this too! Though I have come around some of the limitations by using Groups, Lua and
!SetOption, it would still be worth to bring this system to Measures too, in order to fix the same issue
MeterStyles solve(d), that is classes and repetition (and also to keep parity).
Ever since I made that post with examples, the only other place where I wished I had
MeasureStyles was when making an HSL example.
The skin I made was
Code: Select all
[Rainmeter]
Update=25
[Variables]
V=1
S=1
[DummyMeter]
Meter=string
[Loop]
Measure=Loop
StartValue=1
EndValue=360
[V]
Measure=Calc
Formula=#V#
[S]
Measure=Calc
Formula=#S#
[H]
Measure=Calc
Formula=Loop
[C]
Measure=Calc
Formula=V*S
[X]
Measure=Calc
Formula=C*(1 - Abs( H/60 % 2 - 1) )
[m]
Measure=Calc
Formula=V-C
; newlined to make it easier to read
[Rprime]
Measure=Calc
Formula=(0 <= H) && (H < 60) ?
C :((60 <= H) && (H < 120) ?
X :((120 <= H) && (H < 180) ?
0 :((180 <= H) && (H < 240) ?
0 :((240 <= H) && (H < 300) ?
X :((300 <= H) && (H < 360) ?
C : C)))))
[Gprime]
Measure=Calc
Formula=(0 <= H) && (H < 60) ?
X :((60 <= H) && (H < 120) ?
C :((120 <= H) && (H < 180) ?
C :((180 <= H) && (H < 240) ?
X :((240 <= H) && (H < 300) ?
0 :((300 <= H) && (H < 360) ?
0 : 0)))))
[Bprime]
Measure=Calc
Formula=(0 <= H) && (H < 60) ?
0 :((60 <= H) && (H < 120) ?
0 :((120 <= H) && (H < 180) ?
X :((180 <= H) && (H < 240) ?
C :((240 <= H) && (H < 300) ?
C :((300 <= H) && (H < 360) ?
X : X)))))
[R]
Measure=Calc
Formula=Trunc((Rprime+m)*255)
[G]
Measure=Calc
Formula=Trunc((Gprime+m)*255)
[B]
Measure=Calc
Formula=Trunc((Bprime+m)*255)
[TestShape]
Meter=Image
SolidColor=[R],[G],[B]
H=200
W=200
DynamicVariables=1
but if I had MeasureStyles, the skin would become
Code: Select all
[Rainmeter]
Update=25
[Variables]
V=1
S=1
; put like this here for convenience to read, however they should be one line down
Rp1=C Gp1=X Bp1=0
Rp2=X Gp2=C Bp2=0
Rp3=0 Gp3=C Bp3=X
Rp4=0 Gp4=X Bp4=C
Rp5=X Gp5=0 Bp5=C
Rp6=C Gp6=0 Bp6=X
[DummyMeter]
Meter=string
[Loop]
Measure=Loop
StartValue=1
EndValue=360
[V]
Measure=Calc
Formula=#V#
[S]
Measure=Calc
Formula=#S#
[H]
Measure=Calc
Formula=Loop
[C]
Measure=Calc
Formula=V*S
[X]
Measure=Calc
Formula=C*(1 - Abs( H/60 % 2 - 1) )
[m]
Measure=Calc
Formula=V-C
; now we need a single measurestyle for all of that previous stuff, since nested variables set the correct measure name! newlined in this example to make it easier to read
[prime]
Formula=(0 <= H) && (H < 60) ?
[#[#CURRENTSECTION#]1] :((60 <= H) && (H < 120) ?
[#[#CURRENTSECTION#]2] :((120 <= H) && (H < 180) ?
[#[#CURRENTSECTION#]3] :((180 <= H) && (H < 240) ?
[#[#CURRENTSECTION#]4] :((240 <= H) && (H < 300) ?
[#[#CURRENTSECTION#]5] :((300 <= H) && (H < 360) ?
[#[#CURRENTSECTION#]6] : [#[#CURRENTSECTION#]6])))))
[Rp]
Measure=Calc
MeasureStyle=prime
[Gp]
Measure=Calc
MeasureStyle=prime
[Bp]
Measure=Calc
MeasureStyle=prime
[R]
Measure=Calc
Formula=Trunc((Rp+m)*255)
[G]
Measure=Calc
Formula=Trunc((Gp+m)*255)
[B]
Measure=Calc
Formula=Trunc((Bp+m)*255)
[TestShape]
Meter=Image
SolidColor=[R],[G],[B]
H=200
W=200
DynamicVariables=1