It is currently March 29th, 2024, 8:40 am

RainRGB for beginners

General topics related to Rainmeter.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

RainRGB for beginners

Post by rbriddickk84 »

Greetings.

I'm looking for some instructions or help to get started with RainRGB. I am not that big programmer and cannot found documentation about this exe.
For example changing a string color with this exe.
For any help i would be glad!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RainRGB for beginners

Post by jsmorley »

I think the Readme.txt that comes with the RainRGB4 addon explains how to use it pretty well:

Code: Select all

RainRGB4.exe is Copyright 2010, 2011 by Jeffrey Morley
Released under Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version 4 - Sep 12, 2011

RainRGB when called with the appropriate command line parameters will open a standard Windows color picker dialog.

It will then change the desired color variable in the [Variables] section of any .inc / ini file and refresh either a single config or all when completed.  This can be used in combination with @Include files to have a way to set the colors for an entire suite of skins, or with an individual .ini file to set the colors for a single skin.

RainRGB4.exe may reside in any folder.

Usage:
RainRGB4.exe VarName=xxx FileName=xxx Alpha=xxx RefreshConfig=xxx

Example as called from Rainmeter:

SomeAction=["#ADDONSPATH#RainRGB\RainRGB.exe" "VarName=MyTextColor" "FileName=#CURRENTPATH#UserVariables.inc" "Alpha=200" "RefreshConfig=RainRGB"]

You MUST put quotes around the call to the executable and each parameter.

- VarName : REQUIRED
Name of the variable you wish to set in the .inc / ini file.  It must not contain spaces or use the # character.

The variable must be defined in the .inc / .ini file under [Variables]

- FileName : REQUIRED
Full path and name of the .inc or .ini file you wish to change.  RainRGB will read the file, and look for 
an entry for VarName in the [Variables] section.

- Alpha : OPTIONAL
Must be a decimal number from 0-255. Do not use hex numbers for this.  If the entry in the .inc / ini file is in hex, RainRGB will detect this and convert as needed.  This entire parameter may be left off if desired. If the entry in the .inc / ini has an alpha value on the setting, it will be preserved if you do not specify Alpha on this command line.

- 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.

Notes:

The variable must already exist in the .inc / ini file under [Variables] and be set to some value.  This addon is to change variables, not create them.

If the setting in the .inc / .ini file is in hex currently (ex: MyColor=FFFFFF or MyColor=FFFFFFFF) RainRGB will preserve this format.  If the current setting in the .inc / ini is in RGB (ex: MyColor=255,255,255 or MyColor=255,255,255,255) RainRGB will preserve that format.

To leave a parameter off, remove the entire "ParmName=ParmValue" entry. Do not set the parameter to "" (NULL) to achieve this.

For example to call the addon without changing the alpha value, and refreshing all skins instead of a specific one:

SomeAction=["#ADDONSPATH#RainRGB\RainRGB.exe" "VarName=MyTextColor" "FileName=#CURRENTPATH#UserVariables.inc"]

Remember that VarName and FileName are REQUIRED.  RainRGB will just silently exit without making any changes if they are missing.
But here is an example skin you can run and tear apart to see it in action:

Note: the RainRGB4.exe addon is already included with the attached .rmskin
RainRGBExample_1.0.rmskin
01.jpg
02.jpg
RainRGBExample.ini:

Code: Select all

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

[Metadata]
Name=RainRGBExample
Author=JSMorley
Information=Demonstrates using the RainRGB4.exe addon to set colors in Rainmeter
Version=Mar 26, 2014
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
@Include=#@#Variables.inc

[MeasureCPU]
Measure=CPU

[MeterCPUBar]
Meter=Bar
MeasureName=MeasureCPU
W=200
H=20
BarColor=#MyBarColor#
SolidColor=47,47,47,255
BarOrientation=Horizontal

[MeterCPULabel]
Meter=String
X=3
Y=2
FontSize=12
FontColor=#MyLabelColor#
StringAlign=Left
AntiAlias=1
Text=CPU

[MeterCPUValue]
Meter=String
MeasureName=MeasureCPU
X=197
Y=2
FontSize=12
FontColor=#MyValueColor#
StringAlign=Right
AntiAlias=1
Text=%1%

[MeterChangeBarColor]
Meter=String
X=0
Y=10R
W=200
H=20
FontSize=12
FontColor=#MyBarColor#
SolidColor=47,47,47,255
Padding=3,3,0,0
AntiAlias=1
Text=Change Bar Color
LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=MyBarColor" "FileName=#@#Variables.inc" "RefreshConfig=#CURRENTCONFIG#"]

[MeterChangeLabelColor]
Meter=String
X=0
Y=5R
W=200
H=20
FontSize=12
FontColor=#MyLabelColor#
SolidColor=47,47,47,255
Padding=3,3,0,0
AntiAlias=1
Text=Change Label Color
LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=MyLabelColor" "FileName=#@#Variables.inc" "RefreshConfig=#CURRENTCONFIG#"]

[MeterChangeValueColor]
Meter=String
X=0
Y=5R
W=200
H=20
FontSize=12
FontColor=#MyValueColor#
SolidColor=47,47,47,255
Padding=3,3,0,0
AntiAlias=1
Text=Change Value Color
LeftMouseUpAction=["#@#Addons\RainRGB4.exe" "VarName=MyValueColor" "FileName=#@#Variables.inc" "RefreshConfig=#CURRENTCONFIG#"]
@Resources\Variables.inc:

Code: Select all

[Variables]
MyBarColor=61,184,79,255
MyLabelColor=255,248,217,255
MyValueColor=207,255,248,255
You do not have the required permissions to view the files attached to this post.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: RainRGB for beginners

Post by rbriddickk84 »

Absolutely perfect! :thumbup:
Much appretiation for your help and quick answer!!!! :D