JayVodka wrote:That may be the problem but there's also the other issue I have to address... I'm assuming that RGB colors contain only integer values correct? If that is so then I need to establish a certain proportion between the max value of the meter and the max value of the RGB colors which doesn't seem to get me very nice numbers... I think that rounding might be a possible solution but I feel that something may become desynchronized in doing so.
Well it is not clear to me what you are trying to accomplish. If you are trying to have the Lua script "transition" the color from one to the other in some loop in Lua, that will just never work. Rainmeter goes out to the Lua, the Lua is executed, and all the actions that the Lua does to the skin all happen at once when the script returns to Rainmeter. So sending a blizzard of SKIN:Bang() commands all setting the same value to the skin in a loop will not cause them to be done in some discrete way, just the "last"one will happen really.
It is perfectly fine to set the three components of the color code, so you can do separate math on them and put them together when you set the FontColor or BarColor or whatever it is in the skin.
You can also directly set colors if you want, and not use three variables in the skin, and it might be a bit easier too.
sRed=0
sGreen=150
sBlue=255
SKIN:Bang('!SetOption MeterName FontColor '..sRed..','..sGreen..','..sBlue)
Yes, RRR,GGG,BBB,AAA colors in Rainmeter consist of integers from 0 - 255. However I'm fairly sure Rainmeter will just use the "floor" of each number if they have decimal places. 255.2,255.8,255.1,255 is still white... You can however round numbers in Lua, and it is probably cleaner. You don't have to worry too much about "rounding errors" creeping in over time, as you should and do get a fresh copy of the value of the measure each Update() and so you are presumably only going to round each number once.
Code: Select all
function round(num, places)
local mult = 10^(places or 0)
return math.floor(num * mult + 0.5) / mult
end
As i said, I'm not sure where you are going. Seems like an awful lot going on here to just get a value of a measure and set the RRR,GGG,BBB values accordingly. Maybe if you describe exactly what the goal is...