Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 509

Meters as color: what am i doing wrong?

$
0
0
I am trying to make a shape color changing based on a temperature measure, but i'm clearly missing something.

This is a sample code:

Code:

[Rainmeter]Update=500AccurateText=1[Metadata]Name=Test & DebugAuthor=ParduzInformation=To test and debug scripts and codeVersion=0.1License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0[Variables]TempMin=30TempMax=45TempRange=(#TempMax#-#TempMin#);#################################################;### MEASURES ####################################;#################################################; Simulated Temperature[m_DebugLoop]Measure=LoopStartValue=#TempMin#EndValue=#TempMax#MinValue=#TempMin#MaxValue=#TempMax#DynamicVariables=1[m_PingPong]Measure=CalcIfCondition=m_DebugLoop = #TempMax#IfTrueAction=[!SetOption m_DebugLoop InvertMeasure 1][!UpdateMeasure m_DebugLoop]IfCondition2=m_DebugLoop = #TempMin#IfTrueAction2=[!SetOption m_DebugLoop InvertMeasure 0][!UpdateMeasure m_DebugLoop];The temperature as if the min is 0[m_0Temp]Measure=CalcFormula=(m_DebugLoop-#TempMin#);The temperature as percent of the range[m_0TempPerc]Measure=CalcFormula=(m_0Temp/#TempRange#);Color components as a proportion of the Temp %[m_Comp0_255]Measure=CalcFormula=m_0TempPerc*255[m_Comp0_128]Measure=CalcFormula=m_0TempPerc*128[m_Comp128_255]Measure=CalcFormula=m_0TempPerc*128+128[m_TempColor]Measure=CalcFormula=m_0TempPerc*255 , (1-m_0TempPerc)*255 , 0 , m_0TempPerc*128+128[m_TempColor1]Measure=CalcFormula=m_Comp0_255 , m_Comp0_255 , 0 , m_Comp128_255;#################################################;### METERS ######################################;#################################################; The temp bar[mt_Thermometer_Shp_Bg]Meter=ShapeShape=Path1 BGPath | StrokeWidth 3 | Stroke Color 0 , 255 , [m_Comp0_128] , 255 | Fill Color 0 , 255 , [m_0TempPerc]*128 , 128BGPath= 20,20 | LineTo 400,20 | LineTo 400,50 | LineTo 20,50 | ClosePath 1DynamicVariables=1
rainmeter shape color.jpg
My goal is to use a #Variable#, or a [Measure], to define the Stroke and the Fill colors (i mean, inplace of the 4 values separated by commas).

The shape stroke and fill color should be the same (transparency apart), and changing depending on the m_0TempPerc Measure, but when i put the math expression instead of a measure doing it, the color never changes.

I've tried also to make Measures that outputs the whole color (m_TempColor and m_TempColor1) but then all i got is white.

Seems to me that i'm missing something obvious about how Rainmeter Measures output works, so I am asking for help.
Shouldn't m_0TempPerc outputs a string usable as a color?
Why i can't use math on the shape color?

Could someone teach me?

Statistics: Posted by Parduz — Today, 10:52 am — Replies 0 — Views 8



Viewing all articles
Browse latest Browse all 509

Trending Articles