It is currently October 19th, 2020, 3:15 pm

Code for changing font colour if there's new mails

Help with creating, editing & fixing problems with skins
SpeedChaser
Posts: 16
Joined: February 18th, 2010, 10:32 am

Code for changing font colour if there's new mails

Post by SpeedChaser »

Hey guys!

I'd like to make my inbox counter to change it's colour when there's new message(s) in my mailbox. Which code should I use?

For now my code looks like this:

Code: Select all

[Messages]
Meter=STRING
MeasureName=MeasureNumber
X=106
Y=22
FontColor=255,255,255,200
FontFace=Calibri
FontSize=12
StringAlign=LEFT
StringStyle=BOLD
AntiAlias=1
Text="%1"
Postfix=""
AntiAlias=1
AutoScale=1
User avatar
Alex2539
Rainmeter Sage
Posts: 648
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Code for changing font colour if there's new mails

Post by Alex2539 »

At the top under [Variables] you will need to add a new variable like this:

Code: Select all

MailColor=255,255,255,200
Then, under [MeasureNumber], you will need to add these lines (change the colours to whatever you like):

Code: Select all

IfAboveValue=0
IfAboveAction=!RainmeterSetVariable MailColor 128,128,255,200
IfBelowValue=1
IfBelowAction=!RainmeterSetVariable MailColor 255,255,255,200
Finally, in [Messages], change the FontColor line to this:

Code: Select all

FontColor=#MailColor#
Then, add this line to it:

Code: Select all

DynamicVariables=1
ImageImageImageImage
SpeedChaser
Posts: 16
Joined: February 18th, 2010, 10:32 am

Re: Code for changing font colour if there's new mails

Post by SpeedChaser »

I really appreciate your help! Thanks Alex :)