It is currently January 26th, 2021, 10:41 pm

Colors changing

Help with creating, editing & fixing problems with skins
MarkKane
Posts: 1
Joined: January 6th, 2021, 8:04 am

Colors changing

Post by MarkKane »

I've tried a few different approaches to this and cant get any to work. I'm trying to show a value that if its under a limit value will display one color but changes colors if it goes over that limit value and changes back if it falls back under it. The variation of coding for it I stopped on works for if the value goes over the limit, but will not change back. It doesn't seem that the ifBelowAction line ever gets executed. Here is the example sections of the version of what I have now:

Code: Select all

[HWiNFOMOBOTemp1]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#HWiNFO-MOBO2-SensorId#
HWiNFOSensorInstance=#HWiNFO-MOBO2-SensorInstance#
HWiNFOEntryId=#HWiNFO-MOBO2-Motherboard-Temp#
HWiNFOType=CurrentValue
IfAboveValue=#HWiNFO-MOBO2-TempLimit#
IfAboveAction=[!SetOption MeterHWiNFOMOBOTemp1Value FontColor 255,0,0,255][!Redraw]
IfBelowValue=#HWiNFO-MOBO2-TempLimit#
IfBelowAction=[!SetOption MeterHWiNFOMOBOTemp1Value FontColor 220, 220, 0, 255][!Redraw]
MinValue=0
MaxValue=100

[MeterHWiNFOMOBOTemp1Value]
Meter=String
StringAlign=Right
MeasureName=HWiNFOMOBOTemp1
X=#sWidth#
Y=0r
Text="%1°"
NumOfDecimals=0
MeterStyle=HWiNFOTextStyle
FontColor=#HWiNFOColor2#
I'm not sure what I'm doing wrong or if there is a better way to do it. Any help would be appreciated.
User avatar
balala
Rainmeter Sage
Posts: 12112
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Colors changing

Post by balala »

MarkKane wrote: January 6th, 2021, 8:07 am I'm not sure what I'm doing wrong or if there is a better way to do it. Any help would be appreciated.
You've added spaces into the color code which should have be set into the IfBelowAction option and this confuses Rainmeter. The solution is pretty simle: you either have to quote the color code, or not use spaces. Or even better both: IfBelowAction=[!SetOption MeterHWiNFOMOBOTemp1Value FontColor "220,220,0,255"][!UpdateMeter "MeterHWiNFOMOBOTemp1Value"][!Redraw]. The same thing does work in the IfAboveAction option, because there are no spaces. Some details here: https://forum.rainmeter.net/viewtopic.php?f=5&t=15253&p=85604#p85604
Additionally note two things:
  • The code does nothing when the value of the measure is equal with #HWiNFO-MOBO2-TempLimit#, because this value is not included neither in the IfAboveValue, nor in IfBellowValue. Even if you can add an IfEqualValue / IfEqualAction options pair, I recommend to switch to IfConditions instead, which is a newer and much versatile option. Let us know if you need assistence.
  • Beside quoting the code and removing the spaces, I also added a !UpdateMeter bang, because without it, redrawing the skin doesn't make too much sense.