I would do something like:
Skin:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[MeasureDay]
Measure=Time
Format=%A
[MeasureNewDay]
Measure=Time
Format=%#H
IfEqualValue=0
IfEqualAction=!Execute [!UpdateMeasure MeasureRandom][!CommandMeasure MeasureScript "SelectColor([MeasureRandom]);"]
DynamicVariables=1
[MeasureRandom]
Measure=Calc
Formula=Random
UpdateRandom=1
LowBound=1
HighBound=10
UpdateDivider=-1
[MeasureScript]
Measure=Script
ScriptFile=#CURRENTPATH#Test.lua
UpdateDivider=-1
[MeterDay]
MeasureName=MeasureDay
Meter=STRING
X=0
Y=0
FontColor=255,255,255,255
FontSize=20
FontFace=Arial
StringAlign=LEFT
StringStyle=Normal
AntiAlias=1
DynamicVariables=1
Test.lua:
Code: Select all
function Initialize()
tColors =
{
'250,117,120';
'250,117,188';
'219,117,250';
'117,120,250';
'117,181,250';
'117,250,250';
'117,250,170';
'155,250,117';
'248,250,117';
'250,210,117';
}
end -->Initialize
function SelectColor(parm)
SKIN:Bang('!SetOption MeterDay FontColor '..tColors[parm])
end -->SelectColor
What this does once a day (and on refresh) is get a random number in the skin from 1 to 10 (it could be from 1 to any number of colors you want). Then it fires that random number to the Lua script as a parameter to a function called SelectColor(). In the Lua, we have set up a table when the skin is first loaded that contains 10 color codes. (again you could have as many as you want, just need to change the skin to match) The SelectColor() function uses the parameter passed by the skin, which is that number from 1 to 10, and selects the matching color code out of the tColors table. Then it simply sets the FontColor of the meter to that color using a bang.
Let me know if there is anything here you don't understand, I'll try to further explain if needed.