It is currently March 28th, 2024, 7:52 pm

Weather temperature Dynamic Color

Get help with creating, editing & fixing problems with skins
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

I used the example above but the dash continues to be colored

Code: Select all

[Variables]

ValueColor0=255,255,255
ValueColor1=0,228,0
ValueColor2=255,255,0
ValueColor3=255,126,0
ValueColor4=255,0,0
ValueColor5=143,63,151
ValueColor6=126,0,35

[MeasureValue]
Measure=WebParser
Url=[MeasureName]
StringIndex=4
IfMatch=#
IfMatchAction=[!SetVariable Dash "1"]
IfNotMatchAction=[!SetVariable Dash "0"]

[MeasureColorValue]
Measure=Calc
Formula=(( #Dash# = 1 ) ? 0 : (((MeasureValue >= 0) && (MeasureValue <= 50)) ? 1 : (((MeasureValue >= 51) && (MeasureValue <= 100)) ? 2 : (((MeasureValue >= 101) && (MeasureValue <= 150)) ? 3 : (((MeasureValue >= 151) && (MeasureValue <= 200)) ? 4 : (((MeasureValue >= 201) && (MeasureValue <= 300)) ? 5 : 6))))))
 
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic Color

Post by balala »

xenium wrote:I used the example above but the dash continues to be colored
Make sure you have added the DynamicVariables=1 option to the [MeasureColorValue] measure. I added it to my [MeasureColor] measure, but in your code it isn't added to your [MeasureColorValue] measure.
Supplementary you can add a Dash=1 variable to the [Variables] section. I didn't added it before, but you can add it to see if this helps.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

balala wrote:Make sure you have added the DynamicVariables=1 option to the [MeasureColorValue] measure. I added it to my [MeasureColor] measure, but in your code it isn't added to your [MeasureColorValue] measure.
Supplementary you can add a Dash=1 variable to the [Variables] section. I didn't added it before, but you can add it to see if this helps.
I added Dash=1, but the dash still appears colored (DynamicVariables=1 option was added but when I copied the code I omitted)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic Color

Post by balala »

xenium wrote:I added Dash=1, but the dash still appears colored (DynamicVariables=1 option was added but when I copied the code I omitted)
Please post the whole code as you have it now (again, even if you've posted before).
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

balala wrote:Please post the whole code as you have it now (again, even if you've posted before).

Code: Select all

[Variables]

Dash=1

ValueColor0=255,255,255
ValueColor1=0,228,0
ValueColor2=255,255,0
ValueColor3=255,126,0
ValueColor4=255,0,0
ValueColor5=143,63,151
ValueColor6=126,0,35

[MeasureValue]
Measure=WebParser
Url=[MeasureName]
StringIndex=4
IfMatch=#
IfMatchAction=[!SetVariable Dash "1"]
IfNotMatchAction=[!SetVariable Dash "0"]

[MeasureColorValue]
Measure=Calc
Formula=(( #Dash# = 1 ) ? 0 : (((MeasureValue >= 0) && (MeasureValue <= 50)) ? 1 : (((MeasureValue >= 51) && (MeasureValue <= 100)) ? 2 : (((MeasureValue >= 101) && (MeasureValue <= 150)) ? 3 : (((MeasureValue >= 151) && (MeasureValue <= 200)) ? 4 : (((MeasureValue >= 201) && (MeasureValue <= 300)) ? 5 : 6))))))
DynamicVariables=1 
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic Color

Post by balala »

OK, I'll take look tomorrow, because here is almost midnight.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

balala wrote:OK, I'll take look tomorrow, because here is almost midnight.
ok
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

The dash appeared white only when I filled out the formula and I forgot to add another bracket at the end of the formula.
At the moment I said it worked, but when the value was displayed, it was white
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic Color

Post by balala »

xenium wrote:

Code: Select all

[Variables]

Dash=1

ValueColor0=255,255,255
ValueColor1=0,228,0
ValueColor2=255,255,0
ValueColor3=255,126,0
ValueColor4=255,0,0
ValueColor5=143,63,151
ValueColor6=126,0,35

[MeasureValue]
Measure=WebParser
Url=[MeasureName]
StringIndex=4
IfMatch=#
IfMatchAction=[!SetVariable Dash "1"]
IfNotMatchAction=[!SetVariable Dash "0"]

[MeasureColorValue]
Measure=Calc
Formula=(( #Dash# = 1 ) ? 0 : (((MeasureValue >= 0) && (MeasureValue <= 50)) ? 1 : (((MeasureValue >= 51) && (MeasureValue <= 100)) ? 2 : (((MeasureValue >= 101) && (MeasureValue <= 150)) ? 3 : (((MeasureValue >= 151) && (MeasureValue <= 200)) ? 4 : (((MeasureValue >= 201) && (MeasureValue <= 300)) ? 5 : 6))))))
DynamicVariables=1 
Would have be good the WHOLE code. Everything, from its start to the end, please, not just a few sections.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic Color

Post by xenium »

balala wrote:Would have be good the WHOLE code. Everything, from its start to the end, please, not just a few sections.

Code: Select all

[Rainmeter]
Update=1000


[Variables]
UpdateRateSeconds=600
FontFace=arial
URL=http://aqicn.org/city/usa/washington/maple-falls/azure-way/

Dash=1

ValueColor0=255,255,255
ValueColor1=0,228,0
ValueColor2=255,255,0
ValueColor3=255,126,0
ValueColor4=255,0,0
ValueColor5=143,63,151
ValueColor6=126,0,35


[MeasureValue]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<td id='cur_so2' class='tdcur' style='.*' align=center>(.*)</td>
UpdateRate=#UpdateRateSeconds#
StringIndex=1
IfMatch=#
IfMatchAction=[!SetVariable Dash "1"]
IfNotMatchAction=[!SetVariable Dash "0"]

[MeasureColorValue]
Measure=Calc
Formula=(( #Dash# = 1 ) ? 0 : (((MeasureValue >= 0) && (MeasureValue <= 50)) ? 1 : (((MeasureValue >= 51) && (MeasureValue <= 100)) ? 2 : (((MeasureValue >= 101) && (MeasureValue <= 150)) ? 3 : (((MeasureValue >= 151) && (MeasureValue <= 200)) ? 4 : (((MeasureValue >= 201) && (MeasureValue <= 300)) ? 5 : 6))))))
DynamicVariables=1


[MeterValue]
Meter=String
MeasureName=MeasureValue
X=150
Y=150
W=270
H=50
FontColor=[#ValueColor[&MeasureColorValue]]
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=left
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=30
DynamicVariables=1