It is currently April 27th, 2024, 5:30 pm

[Help]RainRGB and Multiple Variables

Get help with creating, editing & fixing problems with skins
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

[Help]RainRGB and Multiple Variables

Post by Lightz39 »

Hey there I am currently making a suite that has a bunch of tiles. I want the user to be able to set the background color, primary font color and secondary font color using rainrgb. I got this far but it doesn't work how I would like. So basically I have it right now when you mouse over a tile a button appears that you can click. It brings up the picker and sets the color. Right now however I have it so left mouse, middle mouse and right mouse change each color. What I would like is to click the button with my left mouse and have it ask me for 3 colors so you don't have to use a different mouse button for each color. I also want the ability to have each tile be a different color instead of all changing at once. So I would like to stay away from a default config file that sets each. Any ideas on how I could do this?
User avatar
haibusa2005
Posts: 52
Joined: June 15th, 2011, 7:23 pm
Location: Bulgaria, Varna

Re: [Help]RainRGB and Multiple Variables

Post by haibusa2005 »

You can add a popup that appears on left click ang gives the user a choice of colors. On click a local variable is set which should do the trick. By local variable I mean something like !SetVariable TileClock "#ColorRed#"
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Help]RainRGB and Multiple Variables

Post by Kaelri »

Lightz39 wrote:What I would like is to click the button with my left mouse and have it ask me for 3 colors so you don't have to use a different mouse button for each color.
This is possible, but not easy. Since RainRGB requires a refresh before Rainmeter can see the new color, you would need the following things to happen in order:

1) The user clicks the button and selects the first color.
2) RainRGB refreshes the skin.
3) A script detects that the first color has changed, probably by comparing it to a backup variable which stores the color value from before the change.
4) The script updates the backup variable (so that this doesn't happen again and again).
5) The script automatically launches RainRGB again, and the user selects the second color.
6) RainRGB refreshes the skin.
7) The script detects that the second color has changed.
8) The script updates the second backup value.
9) The script automatically launches RainRGB, and the user selects the third color.
10) RainRGB refreshes the skin.

...so, yeah. Possible, but complex, especially if this is repeated for every tile in every skin. And you might have problems if the user interrupts the process, e.g. by closing RainRGB or the skin before they're done picking colors.

I think having three separate buttons would be easier both from a usability and an engineering standpoint. But it's up to you, of course.
Lightz39 wrote:I also want the ability to have each tile be a different color instead of all changing at once. So I would like to stay away from a default config file that sets each. Any ideas on how I could do this?
Easy enough. Each tile's button can send a different command to RainRGB, so just make sure they each target a variable name that is unique to that tile. Example:

Code: Select all

LeftMouseUpAction=["#@#Addons\RainRGB\RainRGB.exe" "VarName=TileColor3" "FileName=#CURRENTFILE#" "RefreshConfig=#CURRENTCONFIG#"]
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: [Help]RainRGB and Multiple Variables

Post by Lightz39 »

I am thinking that's a little over kill. I'll just go with 3 buttons like you suggested.