Quantcast
Viewing all articles
Browse latest Browse all 708

Help: Rainmeter Skins • Re: Meters as color: what am i doing wrong?

I am trying to make a shape color changing based on a temperature measure, but i'm clearly missing something.
[...]
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.
First, you don't absolutely need to use a ton of measures for each mathematical step, you can use your variables and measure directly in the meter. Secondly, whenever you write a formula in Rainmeter, it has to be enclosed by round brackets. So, simplifying your code a bit, and based exacly on your existing formulas from the removed measures:

Code:

[Rainmeter]Update=50AccurateText=1DynamicWindowSize=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=45;#################################################;### 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];#################################################;### METERS ######################################;#################################################; The temp bar[mt_Thermometer_Shp_Bg]Meter=ShapeShape=Path1 BGPath | StrokeWidth 3 | Stroke Color 0 , 255 , ((([m_DebugLoop]-#TempMin#)/(#TempMax#-#TempMin#))*128) , 255 | Fill Color 0 , 255 , ((([m_DebugLoop]-#TempMin#)/(#TempMax#-#TempMin#))*128) , 128BGPath= 20,20 | LineTo 400,20 | LineTo 400,50 | LineTo 20,50 | ClosePath 1DynamicVariables=1
I temporarily changed the Update to 50 for the change to be more obvious, since the colors at the range's bounds are quite similar. The formulas in the meter became longer due to applying them directly there, but at least you have them in the same place, in a clear fashion.

P.S. An "R,G,B,A" color is a string, you cannot apply numerical formulas to it or use it in a Calc measure like you tried in [m_TempColor] and [m_TempColor1]. However, you can apply numerical formulas to each of the R, G, B or A values separately, and construct the "R,G,B,A" string based on those.

Statistics: Posted by Yincognito — Today, 1:02 pm



Viewing all articles
Browse latest Browse all 708

Trending Articles