Now it's past midnight here and I'm going to sleep, but I promise tomorrow I'll help you with this, too.xenium wrote:yes,when the weather data is updated and the temperature corresponds to another temperature range
It is currently September 26th, 2023, 5:53 am
Weather temperature Dynamic Color
-
- Rainmeter Sage
- Posts: 15668
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather temperature Dynamic Color
-
- Posts: 815
- Joined: January 4th, 2018, 9:52 pm
Re: Weather temperature Dynamic Color
thank you very much and .... easy sleepbalala wrote:Now it's past midnight here and I'm going to sleep, but I promise tomorrow I'll help you with this, too.

-
- Rainmeter Sage
- Posts: 15668
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather temperature Dynamic Color
Here is my solution. The only thing you should have to do is to add the following two options to the [MeasureSlide] measure:
That's all. Although this will work (I hope), I'm not sure at all you'll see the temperature value filling up, because usually the temperature doesn't change too much on two consecutive update cycles, and the colors belonging to close temperature values are close enough to be hard to see the filling up. But the method works.
Just two more remarks:
Code: Select all
[MeasureSlide]
...
IfCondition=(#W#>=100)
IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!SetVariable W "0"][!SetVariable Color "[#TempColor[&MeasureColor]]"]#U#
Just two more remarks:
- The quotation marks aren't needed around no options, eg around the RegExp. Eg I recommend to replace the RegExp option of the [MeasureName] measure (RegExp=[color=#FF0000]"[/color](?siU)<h1>(.*)</h1>[color=#FF0000].*"[/color]) with the following simpler one: RegExp=(?siU)<h1>(.*)</h1>.
- As I said, the AppVersion option (used in the [Rainmeter] section) is deprecated and should have to be removed, while the Author was moved to [Metadata]. Because of this, these two section should have to look like, for example, in the following way:
instead of the original [Rainmeter] section:
Code: Select all
[Rainmeter] Update=1000 [Metadata] Author=xxenium
Code: Select all
[Rainmeter] Author=xxenium AppVersion=1.0
-
- Posts: 815
- Joined: January 4th, 2018, 9:52 pm
Re: Weather temperature Dynamic Color
It really works!balala wrote:Here is my solution. The only thing you should have to do is to add the following two options to the [MeasureSlide] measure:That's all. Although this will work (I hope), I'm not sure at all you'll see the temperature value filling up, because usually the temperature doesn't change too much on two consecutive update cycles, and the colors belonging to close temperature values are close enough to be hard to see the filling up. But the method works.Code: Select all
[MeasureSlide] ... IfCondition=(#W#>=100) IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!SetVariable W "0"][!SetVariable Color "[#TempColor[&MeasureColor]]"]#U#
Just two more remarks:
- The quotation marks aren't needed around no options, eg around the RegExp. Eg I recommend to replace the RegExp option of the [MeasureName] measure (RegExp=[color=#FF0000]"[/color](?siU)<h1>(.*)</h1>[color=#FF0000].*"[/color]) with the following simpler one: RegExp=(?siU)<h1>(.*)</h1>.
- As I said, the AppVersion option (used in the [Rainmeter] section) is deprecated and should have to be removed, while the Author was moved to [Metadata]. Because of this, these two section should have to look like, for example, in the following way:
instead of the original [Rainmeter] section:Code: Select all
[Rainmeter] Update=1000 [Metadata] Author=xxenium
Code: Select all
[Rainmeter] Author=xxenium AppVersion=1.0
Thank you very much
We changed the values from [MeasureSlide] ActionList1, from 20 to 200 to reduce fill speed, and for a good visual effect

The visual effect is no longer the same as before, when the color change was over the base white color (now the color changes over the color that was before) but it's ok
-
- Rainmeter Sage
- Posts: 15668
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather temperature Dynamic Color
Obviously you can play with the settings, even if i forgot to explain what those constants are in the ActionTimer plugin measure. But it seems you've figured out by yourself, so it's ok...xenium wrote:We changed the values from [MeasureSlide] ActionList1, from 20 to 200 to reduce fill speed, and for a good visual effect, and so we could see the change in color when switching to a new temperature range.
This is exactly what I said you in my last post, but there is nothing which could be done with this. Maybe eventually just using some very different colors.xenium wrote:The visual effect is no longer the same as before, when the color change was over the base white color (now the color changes over the color that was before) but it's ok
I'm glad if it's working as you wanted.
-
- Posts: 815
- Joined: January 4th, 2018, 9:52 pm
Re: Weather temperature Dynamic Color
I have a small problem .
I use the formula below, which, depending on the interval, displays the values in a certain color.
But when there is no value on the website, a dash is displayed.
It always takes the color of the first interval.
I would like the dash to always have the white color (I do not want to use "subsitute" to stop being displayed)
How can I do that?
I use the formula below, which, depending on the interval, displays the values in a certain color.
But when there is no value on the website, a dash is displayed.
It always takes the color of the first interval.
I would like the dash to always have the white color (I do not want to use "subsitute" to stop being displayed)
How can I do that?
Code: Select all
[Variables]
ValueColor1=0,228,0
ValueColor2=255,255,0
ValueColor3=255,126,0
ValueColor4=255,0,0
ValueColor5=143,63,151
ValueColor6=126,0,35
[MeasureColorValue]
Measure=Calc
Formula=(((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)))))
-
- Rainmeter Sage
- Posts: 15668
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather temperature Dynamic Color
Please post the current code you have, because the last was posted many days ago and probably in the meantime you've rewrote a few things.xenium wrote:I have a small problem .
I use the formula below, which, depending on the interval, displays the values in a certain color.
But when there is no value on the website, a dash is displayed.
It always takes the color of the first interval.
I would like the dash to always have the white color (I do not want to use "subsitute" to stop being displayed)
How can I do that?
-
- Posts: 815
- Joined: January 4th, 2018, 9:52 pm
Re: Weather temperature Dynamic Color
I managed to find a solution in the meantime.
I added to the String Meter the options:
InlineSetting = Color 255 255 255
InlinePattern = -
I added to the String Meter the options:
InlineSetting = Color 255 255 255
InlinePattern = -
-
- Developer
- Posts: 22590
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather temperature Dynamic Color
This would actually be:xenium wrote:I managed to find a solution in the meantime.
I added to the String Meter the options:
InlineSetting = Color 255 255 255
InlinePattern = -
InlineSetting = Color | 255,255,255
-
- Rainmeter Sage
- Posts: 15668
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather temperature Dynamic Color
Yes, but this (taking in account jsmorley's modification) sets the text to white only if the measure returns the dash in the very first moment, when the skin is refreshed. If in that moment the skin returns a value, then later it turns to the dash, skin doesn't set the color to white. If your code is the last posted code, then the solution I think would be to first add the white color to the [Variables] section: TempColor0=255,255,255. Now add the following options to the [MeasureTemp] measure (besides the exiting options):xenium wrote:I managed to find a solution in the meantime.
I added to the String Meter the options:
InlineSetting = Color 255 255 255
InlinePattern = -
Code: Select all
[MeasureTemp]
...
IfMatch=#
IfMatchAction=[!SetVariable Dash "1"]
IfNotMatchAction=[!SetVariable Dash "0"]
Finally you should have to modify the Formula option of the [MeasureColor] measure and should have to add a DynamicVariables=1 option to the same measure:
Code: Select all
[MeasureColor]
Measure=Calc
Formula=(( #Dash# = 1 ) ? 0 : ( MeasureTemp < -45 ? 1 : (((MeasureTemp >= -45) && (MeasureTemp < -40)) ? 2 : (((MeasureTemp >= -40) && (MeasureTemp < -35)) ? 3 : (((MeasureTemp >= -35) && (MeasureTemp < -30)) ? 4 : (((MeasureTemp >= -30) && (MeasureTemp < -25)) ? 5 : (((MeasureTemp >= -25) && (MeasureTemp < -20)) ? 6 : (((MeasureTemp >= -20) && (MeasureTemp < -15)) ? 7 : (((MeasureTemp >= -15) && (MeasureTemp < -10)) ? 8 : (((MeasureTemp >= -10) && (MeasureTemp < -5)) ? 9 : (((MeasureTemp >= -5) && (MeasureTemp < 0)) ? 10 : (((MeasureTemp >= 0) && (MeasureTemp < 5)) ? 11 : (((MeasureTemp >= 5) && (MeasureTemp < 10)) ? 12 : (((MeasureTemp >= 10) && (MeasureTemp < 15)) ? 13 : (((MeasureTemp >= 15) && (MeasureTemp < 20)) ? 14 : (((MeasureTemp >= 20) && (MeasureTemp < 25)) ? 15 : (((MeasureTemp >= 25) && (MeasureTemp < 30)) ? 16 : (((MeasureTemp >= 30) && (MeasureTemp < 35)) ? 17 : (((MeasureTemp >= 35) && (MeasureTemp < 40)) ? 18 : (((MeasureTemp >= 40) && (MeasureTemp < 45)) ? 19 : 20 ))))))))))))))))))))
DynamicVariables=1