It is currently March 28th, 2024, 11:21 pm

Smooth font colour changes from measure values?

Get help with creating, editing & fixing problems with skins
User avatar
JayOtt
Posts: 14
Joined: February 19th, 2019, 2:15 pm

Smooth font colour changes from measure values?

Post by JayOtt »

Hi all,

I've been searching around, but haven't really found a solution to what I'm trying to do...

I would like the output of a measure (a number between 0 -100) to directly set an RGB value of the fonts colour. So far I have this:

Code: Select all

[MeasureSrvLvl]
Measure=WebParser
URL=[MeasureStats]
StringIndex=14

[MeasureSrvLvlColour]
Measure=Calc
Formula=255 / 100 * MeasureSrvLvl

[MeterSrvLvl]
MeterStyle=Text
FontColor=[MeasureSrvLvlColour],0,0
MeasureName=MeasureSrvLvl
Meter=STRING
X=(#WIDTH#*0.1)
Y=(#HEIGHT#*0.05)
Prefix="Srv Lvl: "
Postfix="%"
It seems to work up to the point of setting the actual colour.
So if for example [MeasureSrvLvl] is equal to 50.47, [MeasureSrvLvlColour] becomes 128.6985 ...

So my questions are:
Firstly how do I reduce [MeasureSrvLvlColour] down to zero decimal places, and secondly how would I use that to set just the red value of the font colour?

[EDIT: Y'know, I think I got it. It's working now... I had a mistake in my MeterStyle right up at the top. :D ]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Smooth font colour changes from measure values?

Post by balala »

Have you figured it out?
However I'd add one detail: add a DynamicVariables=1 option to the [MeterSrvLvl] meter. Its FontColor option uses a section variable (red below) (FontColor=[MeasureSrvLvlColour],0,0), which requires this option to be added.