It is currently November 15th, 2019, 3:46 am

IfCondition to change font color

General topics related to Rainmeter.
TrippleT
Posts: 4
Joined: May 28th, 2018, 9:57 pm

IfCondition to change font color

TrippleT » May 31st, 2018, 5:10 am

Hi,

Hi, I am reading date strings (dd MMM yy) from text files to display on the skins, which is quite easy with Lua script to parse the text into date, compare date to work out if a date is in the future or the past

What I need to achieve is if the date is in the past then it is overdue hence I want to change the skin font (or background) to red. How do I do this with Rainmeter? I still struggle to work with Measures

This is the skin .ini
==================================================================
[Rainmeter]
Update=1000
[Metadata]
Name=AustVVOD
Information=AusVVOD
[Variables]
@Include1=#@#systemColors.ini
@Include2=#@#variables.ini
@Include3=#@#styles.ini
@Include4=#@#background.ini
@Include5=#@#diskSelector.ini
BackgroundHeight=23
MeterBarColor=#WindowsColor#
LeftPadding=15
TopPadding=3
AutoBorder=1
[Lua]
Measure=Script
ScriptFile=#@#LuaReadFile.lua
Disabled=1
[AusVVOD]
Meter=String
MeterStyle=StyleSmallGreenText
Text=AusVVOD: [&Lua:ReadCurrency('D:\MapStore\Obstacles\VVOD.ini')]
DynamicVariables=1
=======================================================================

The Lua code has 2 functions
ReadCurrency(filePath)
return currencyText

IsExpired()
return 1 or 0
User avatar
balala
Rainmeter Sage
Posts: 9052
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfCondition to change font color

balala » May 31st, 2018, 12:15 pm