Quick and rudimentar, without creating a preceding meter for the icon background (here, we set the
SolidColor option of the icon meter itself):
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Icon]
Meter=Image
SolidColor=255,0,0,1
ImageName=#@#Icon.png
MouseOverAction=[!SetOption Icon SolidColor "255,0,0,255"][!UpdateMeter Icon][!Redraw]
MouseLeaveAction=[!SetOption Icon SolidColor "255,0,0,1"][!UpdateMeter Icon][!Redraw]
For fancier results like rounded corners, various gradients, shapes and such, adding and performing things on a preceding
Shape meter would be needed, like RicardoTM mentioned. To avoid having to write the entire option (i.e. line) when altering the Shape option, you could use
variables, !SetVariable and DynamicVariables=1 instead of doing things via !SetOption (here, we set, say, a
BackColor variable, which is then used in the Shape option):
Code: Select all
[Variables]
BackColor=255,0,0,1
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Back]
Meter=Shape
Shape=Rectangle 0,0,32,32,6 | StrokeWidth 0 | Stroke Color 0,0,0,1 | Fill Color #BackColor#
MouseOverAction=[!SetVariable BackColor "255,0,0,255"][!UpdateMeter Back][!Redraw]
MouseLeaveAction=[!SetVariable BackColor "255,0,0,1"][!UpdateMeter Back][!Redraw]
DynamicVariables=1
[Icon]
Meter=Image
ImageName=#@#Icon.png
The above examples assume that you have a 32 x 32 pixel image file called "Icon.png" in the
@Resources subfolder of your skin folder.
Note: using spaces in folder names, image names or paths is perfectly fine, but if you do that, you must enclose such strings between quotes when you use them in bangs (quotes are not necessarily needed when using a string containing spaces as the value of an option):
https://docs.rainmeter.net/manual/skins/option-types/#Action