It is currently October 13th, 2024, 12:22 am

Change Weather Temperature Color.

Get help with creating, editing & fixing problems with skins
pierinho
Posts: 10
Joined: March 1st, 2010, 11:05 am

Change Weather Temperature Color.

Post by pierinho »

I have Rainmeter 1.1 installed, i want change the temperature font color at diverse temperature value.
For example, red vith temperature over 28 celsius, white under 28 and blue under 2 celsius.
I find this example in an weather skin, but only works when temperature increase (change from white to red when temperature pass from 27 to 28), but don't work when temperature decresse (don't change from red to white when temperature pass from 28 to 27)
This is a little example.

Code: Select all

[MeasureWeatherTempKl0]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureAccuWeather]
StringIndex=17
IfBelowValue=2
IfBelowAction=!execute #HideAll#[!RainmeterShowMeter MeterTempDBlau.txt] 

[MeasureWeatherTemp0]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureAccuWeather]
StringIndex=17
IfAboveValue=3
IfAboveAction=!execute #HideAll#[!RainmeterShowMeter MeterTempHBlau.txt] 

[MeterTempDBlau.txt]
MeasureName=MeasureWeatherTempKl0
Meter=STRING
X=+17r
Y=+66r
FontColor=12,0,255,220
StringStyle=BOLD
FontSize=48
StringAlign=RIGHT
StringStyle=BOLD
;StringEffect=BORDER
;FontEffectColor=00,0,0,170
FontFace=Calibri
Antialias=1
Hidden=1

[MeterTempHBlau.txt]
MeasureName=MeasureWeatherTempKl0
Meter=STRING
X=+0r
Y=+0r
FontColor=163,210,245,180
StringStyle=BOLD
FontSize=48
StringAlign=RIGHT
StringStyle=BOLD
;StringEffect=BORDER
;FontEffectColor=00,0,0,170
FontFace=Calibri
Antialias=1
Hidden=1
I's possible to fix this problem,
Thanks
Last edited by Chewtoy on July 15th, 2010, 4:40 pm, edited 1 time in total.
Reason: Use [code] tages when posting code.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Change Weather Temperature Color.

Post by Chewtoy »

First - Get Rainmeter 1.2
Second - [MeasureAccuWeather] ? I would use a weather.com feed but anyhow.

Take a look at this

Code: Select all

[Variables]
FC1=255,0,0,255
FC2=0,255,0,255
FC3=0,0,255,255
WC=#FC2#

;---Increasing
Formula=Counter %50

;---Decreasing
;Formula=50 - (Counter %50)

[CounterPart1]
Measure=Calc
Formula=#Formula#
IfAboveValue=20
IfAboveAction=!Execute [!RainmeterSetVariable WC "#FC2#"][!RainmeterRedraw]
IfBelowValue=30
IfBelowAction=!Execute [!RainmeterSetVariable WC "#FC2#"][!RainmeterRedraw]

[CounterPart2]
Measure=Calc
Formula=#Formula#
IfBelowValue=20
IfBelowAction=!Execute [!RainmeterSetVariable WC "#FC3#"][!RainmeterRedraw]
IfAboveValue=30
IfAboveAction=!Execute [!RainmeterSetVariable WC "#FC1#"][!RainmeterRedraw]


[NumberDisplay]
Meter=String
MeasureName=CounterPart1
Text="%1"
X=0
Y=0
FontColor=#WC#
FontSize=#FontSize#
FontFace=#FontFace#
AntiAlias=#AntiAlias#
SolidColor=0,0,0,1
DynamicVariables=1
Replace the CounterPart with you temp-measure.

Explanation: CounterPart1 turns the text green (in this case) and makes sure to works with both increasing and decreasing values.
CounterPart2 takes care of values that are outside the CounterPart1's range and give them either blue or red colour.
If you want to put it to the test, just use the other formula
I don't think, therefore I'm not.
pierinho
Posts: 10
Joined: March 1st, 2010, 11:05 am

Re: Change Weather Temperature Color.

Post by pierinho »

help me, i don't understand

Code: Select all

[Variables]
FontColorTemp=255,255,255,180

[MeasureWeatherTemp1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://xml.weather.com/weather/local/ITXX0089?cc=*&unit=m&dayf=4StringIndex=17
IfAboveValue=15
IfAboveAction=!RainmeterSetVariable FontColorTemp 255,255,255,180
IfBelowValue=27
IfBelowAction=!RainmeterSetVariable FontColorTemp 255,255,255,180

[MeasureWeatherTemp2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://xml.weather.com/weather/local/ITXX0089?cc=*&unit=m&dayf=4StringIndex=17
IfBelowValue=15
IfBelowAction=!RainmeterSetVariable FontColorTemp 163,210,245,180
IfAboveValue=27
IfAboveAction=!RainmeterSetVariable FontColorTemp 250,130,140,180

[MeterTemp.txt]
MeasureName=MeasureWeatherTemp1
Meter=STRING
DynamicVariables=1
X=+17r
Y=+66r
FontColor=#FontColorTemp#
StringStyle=BOLD
FontSize=48
StringAlign=RIGHT
StringStyle=BOLD
;StringEffect=BORDER
;FontEffectColor=00,0,0,170
FontFace=Calibri
Antialias=1
;Hidden=1
where is the error? can you correct the script?
and it's possible put another range of temperature, with relative colour?
Last edited by Chewtoy on July 15th, 2010, 4:41 pm, edited 1 time in total.
Reason: Use [code] tages when posting code.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Change Weather Temperature Color.

Post by Chewtoy »

Your URL= is wrong.

Should be something like

Code: Select all

[MeasureWeatherTemp1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureThatDoesTheInfoGathering]
StringIndex=17
And: Yes and yes.
Read through the Tips'n'Tricks as well as the Manual.
For the colour, study DynamicVariables. And you could take a look at http://rainmeter.net/forum/viewtopic.php?f=27&t=1596
I don't think, therefore I'm not.
pierinho
Posts: 10
Joined: March 1st, 2010, 11:05 am

Re: Change Weather Temperature Color.

Post by pierinho »

but if i use this code:

Code: Select all

[MeterTemp.txt]MeasureName=MeasureWeatherTemp1
Meter=STRING
DynamicVariables=1
the color change only from the value of MeasureWeatherTemp1
The value of MeasureWeatherTemp2 ae ignored, right?

Sorry for my english, i'm italian and havo some problem with the english manual