It is currently December 15th, 2019, 11:40 am

RainRGB 4.0

Plugins and Addons popular with the Community
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » March 26th, 2014, 3:05 pm

I have updated the Readme.txt that comes with the addon, and created a new example .rmskin that both installs the RainRGB4.exe addon in the skin's @Resources\Addons folder, and demonstrates how to use it.

The actual RainRGB4 executable has not changed.

Get the new .rmskin in the first post of this thread.
anon456
Posts: 3
Joined: April 26th, 2014, 9:28 am

Re: RainRGB 4.0

anon456 » May 19th, 2014, 3:06 pm

Hello, is there any way to make RainRGB4 write color values "divided" like "R=1","G=2" and "B=3" or any way to convert "Color=1,2,3" variable to 3 different variables like "R=1","G=2" and "B=3".

I'm trying to make a skin with [ImageTint] and [ColorMatrix] option to adjust color and contrast. But it seems that ImageMeter doesn't support these at the same time (naturally). So i appreciate if you take time to try to help me out to solve this problem.
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » May 19th, 2014, 3:59 pm

Not something that RainRGB can do, but you can use the String measure (requires the 3.1 beta of Rainmeter from http://rainmeter.net) and a regular expression substitute to break up a color variable into its parts:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
RainRGBColor=166,223,245,255

[MeasureGetColors]
Measure=String
String=#RainRGBColor#
RegExpSubstitute=1
Substitute="^(.*),(.*),(.*),(.*)$":"[!SetVariable Red \1][!SetVariable Green \2][!SetVariable Blue \3][!SetVariable Alpha \4]"
OnUpdateAction=[!SetOption MeasureGetColors OnUpdateAction "[MeasureGetColors]"][!UpdateMeasure MeasureGetColors][!SetOption MeasureGetColors OnUpdateAction ""]
UpdateDivider=-1

[MeterColors]
Meter=String
FontSize=15
FontColor=#RainRGBColor#
SolidColor=50,50,50,255
Padding=5,5,5,5
AntiAlias=1
Text=Red is #Red# : Green is #Green# : Blue is #Blue# : Alpha is #Alpha#
DynamicVariables=1
2014-05-19_113538.jpg
So on the first update the String measure gets the RainRGBColor variable, uses RegExpSubstitute to break it up into \1 \2 \3 \4, and creates a string that is a series of !SetVariable commands that use those individual color components to set separate variables. The first OnUpdateAction then changes itself to that string of commands, updates the measure so the commands are actually executed, and sets itself to nothing, so it stops due to UpdateDivider=-1 and doesn't get in a pointless endless loop.

Then you can use those separate color variables in a dynamic way anywhere you want.
You do not have the required permissions to view the files attached to this post.
anon456
Posts: 3
Joined: April 26th, 2014, 9:28 am

Re: RainRGB 4.0

anon456 » May 19th, 2014, 4:49 pm

Wow, thanks for the quick reply. I updated my rainmeter to 3.1 beta and tried your code to break up a color variable into its parts and it worked just fine. Thank you so much :thumbup:

Now i can start to play around with the color matrix code to adjust both color and contrast :great:
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » May 19th, 2014, 4:51 pm

Glad to help.
Wallboy
Posts: 68
Joined: October 1st, 2012, 4:53 am

Re: RainRGB 4.0

Wallboy » August 18th, 2014, 12:08 pm

Is there any way we can set the color without having to refresh the skin afterwards. Basically the same functionality it currently has. Write the new value to the variable include file, BUT have it also do SetVariable without a Refresh.

With it having to refresh each time, a complicated skin with lots of meters and WebParser measures that grab a resource on refresh can hit the WebParsers URL server many times if you have a lot of different color settings you want to change in a row.

I could manually get this working using Lua. I would just use a "fake" name for the Refresh argument (this will produce an error in the Log, but nothing is refreshed.) And then read the variable include to get the new value that was just written to the file, and use that to SetVariable on the meter and then Update/Redraw.

But if RainRGB used SetVariable, this would be a lot easier.
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » August 18th, 2014, 1:33 pm

Probably not. The largest issue is that what is written to a .inc file is not tied in any externally visible way, to any particular skin or skins. !SetVariable must be targeted at a particular config or "grouup" of configs. There are no "global" variables in Rainmeter, nor would we ever want that. I will chew on this a bit, but it isn't likely to happen in the near-term.

However, as you say, the parameter on the call to RainRGB to "refresh" a config or all configs is forgiving. you can pass a bogus config name to it, and then use Lua (or WebParser) to read the file you "write" the color settings to, and take whatever action you want.
Wallboy
Posts: 68
Joined: October 1st, 2012, 4:53 am

Re: RainRGB 4.0

Wallboy » August 19th, 2014, 1:50 am

Alright thanks. I currently have it implemented to change the color without a refresh now. A LeftMouseUpAction calls a script function which does some SetOption bangs to the Parameter of the RunCommand plugin. Then the RunCommand runs RainRGB with those set parameters. You choose your color and when you hit ok, the RunCommand FinishAction calls another script function which then reads new value that was just written to the include and uses SetVariable and Updates/Redraws. Works great.

The only minor issue is the 'Skin "BogusName" not found' error in the log. But it's not a big deal.
User avatar
Dank420
Posts: 147
Joined: April 3rd, 2013, 1:04 am
Location: O-High-O

Re: RainRGB 4.0

Dank420 » August 19th, 2014, 3:26 am

Could it be possible to have RainRGB refresh groups instead of just config

LeftMouseUPAction=["#@#\RainRGB4.exe" "VarName=EQ1BARColor" "FileName=#@#VUFFTColors.ini" "RefreshConfig=none"][!Refreshgroup livingSound]

doesn't seem to work i have to refresh manually after setting could it do :

LeftMouseUPAction=["#@#\RainRGB4.exe" "VarName=EQ1BARColor" "FileName=#@#VUFFTColors.ini" "RefreshConfiggroup=livingSound"]

trying to avoid global refresh
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB 4.0

jsmorley » August 19th, 2014, 3:54 am

Dank420 wrote:Could it be possible to have RainRGB refresh groups instead of just config

LeftMouseUPAction=["#@#\RainRGB4.exe" "VarName=EQ1BARColor" "FileName=#@#VUFFTColors.ini" "RefreshConfig=none"][!Refreshgroup livingSound]

doesn't seem to work i have to refresh manually after setting could it do :

LeftMouseUPAction=["#@#\RainRGB4.exe" "VarName=EQ1BARColor" "FileName=#@#VUFFTColors.ini" "RefreshConfiggroup=livingSound"]

trying to avoid global refresh
Might work if you use Brian's RunCommand plugin to execute RainRGB, that way you might be able to "wait" for RainRGB to "finish" before executing some other action like a group refresh. Otherwise, the way you have it written, RainRGB will be run, and the !RefreshGroup will be executed immediately. There is no "handshake" between Rainmeter and an external addon executable. So no point in that, you haven't had any time to change or set the color.

While there is no support for "groups", you can refresh multiple configs with RainRGB. From the Readme.txt:
- RefreshConfig : OPTIONAL
This is the name(s) of the Rainmeter config (ex: Enigma\Sidebar) you wish to refresh after the variable has been set.

If this entire parameter is left off, all currently loaded configs will be refreshed. You may specify multiple configs to refresh by using " | " as a separator. Example: "RefreshConfig=JSMorley\JSClock | JSMorley\JSWeather". The spaces before and after the "pipe" character are required.
I'm not terribly inclined to start messing with RainRGB again, and adding more and more parameters to it. Avoiding refresh entirely seems like a "nice to have" 99% of the time, it's not like you are setting colors all the time, it really HAS to write to a file, and for the most part that is going to mean a refresh. Let it refresh a skin, some skins, or all skins... Or use a dummy config name in the call(s) to RainRGB, and then just add an "Update Colors" button to the skin to actually do the refresh just one time.