It is currently April 18th, 2024, 9:39 pm

Automatic Color Change.

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Automatic Color Change.

Post by eclectic-tech »

bill98 wrote:I still don't believe the fontcolor change routine is working. It seems to work on the first background color{Black} and keep the fontcolor white for all subsequent records(Never turning Black). How can I make the color change routine work on all records? Also, I am getting a Cal:Syntax Error on [MeasureColor].
Typo... You misspelled 'Substitute', so the values never subbed... and it causes the error in [MeasureColor].

Code: Select all

[MeasureRed]
Measure=String
String=#BGC#
RegExpSubstitute=1
Substitude="^(\d*),(\d*),(\d*)(,\d*)?$":"\1"
Correct the spelling in all 3 (Red, Blue, Green) measures.

To get color changes to take, I had to refresh PGMLaunch after selecting colors in the RGBScr#.ini. You may need to add a refresh. Right now, I only see a refresh for the settings skin (#CurrentConfig#) but none for PGMLaunch.

This may get font/color changes working.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Automatic Color Change.

Post by bill98 »

Thanks for taking a look at my skin. After rereading your comments I can't tell if you were really told what the problem is. Yes. A refresh is required to register the rectangle color change. It would be nice if was taken care of automatically, but that isn' the primary problem. The problem I was trying to correct is the font color. It should always contrast with the background color so the font is readable. Black on black or white on white in unacceptable. As currently implemented, the font is always white or always black. The secondary skin RGBTLD it doesn't seem to get activated properly for each new rectangle color. Based on the intermediate output I programmed in, once set, the font and rectangle colors never change in the RGBTLD third level skin. I hoped that correction of the spelling errors you found would fix that but it did not. How can I get the RGBTLD skin to register a background color change and properly compute the contrasting font color?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Automatic Color Change.

Post by eclectic-tech »

bill98 wrote:Thanks for taking a look at my skin. After rereading your comments I can't tell if you were really told what the problem is. Yes. A refresh is required to register the rectangle color change. It would be nice if was taken care of automatically, but that isn' the primary problem. The problem I was trying to correct is the font color. It should always contrast with the background color so the font is readable. Black on black or white on white in unacceptable. As currently implemented, the font is always white or always black. The secondary skin RGBTLD it doesn't seem to get activated properly for each new rectangle color. Based on the intermediate output I programmed in, once set, the font and rectangle colors never change in the RGBTLD third level skin. I hoped that correction of the spelling errors you found would fix that but it did not. How can I get the RGBTLD skin to register a background color change and properly compute the contrasting font color?
You also have a misspelled measure in RGBLTD

Code: Select all

[ChkMeasures]
Meter=String
MeasureName=MeasureRrd
...
Should be MeasureName=MeasureRed

Here is a 'working' RGBLTD:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
@Include=#@#VariablesM2.inc
@Include2=#@#Scheme#CSNO#.inc

[IWH]
Meter=String
FontSize=16
x=100
y=30
Text=I Was In RGBTLD


[MeasureRed]
Measure=String
String=#BGC#
RegExpSubstitute=1
Substitute="^(\d*),(\d*),(\d*)(,\d*)?$":"\1"

[ShowRed]
Meter=String
MeasureName=MeasureRed
FontSize=16
x=0
y=150
Text=BGC=#BGC##CRLF#RED=%1

[MeasureGreen]
Measure=String
String=#BGC#
RegExpSubstitute=1
Substitute="^(\d*),(\d*),(\d*)(,\d*)?$":"\2"

[ShowGreen]
Meter=String
MeasureName=MeasureGreen
FontSize=16
x=0
y=200
Text=Green=%1

[MeasureBlue]
Measure=String
String=#BGC#
RegExpSubstitute=1
Substitute="^(\d*),(\d*),(\d*)(,\d*)?$":"\3"

[ShowBlue]
Meter=String
MeasureName=MeasureBlue
FontSize=16
x=0
y=230
Text=Blue=%1

[MeasureColor]
Measure=Calc
Formula=( [MeasureRed] + [MeasureGreen] + [MeasureBlue] )
DynamicVariables=1
IfCondition=(MeasureColor>382)
IfTrueAction=[!WriteKeyValue Variables TFC "0,0,0"  "#@#VariablesM2.inc"][!SetVariable TFC "0,0,0"][!ShowMeter TFCLight]
IfFalseAction=[!WriteKeyValue Variables TFC "255,255,255" #@#VariablesM2.inc"][!SetVariable TFC "255,255,255"][!ShowMeter TFCDark]

[ChkMeasures]
Meter=String
MeasureName=MeasureRed
MeasureName2=MeasureGreen
MeasureName3=MeasureBlue
MeasureName4=MeasureColor
x=0
y=30
FontSize=16
Text=Red %1#CRLF#Green %2#CRLF#Blue %3#CRLF#TFC #TFC##CRLF# MsrColor %4

[TFCDark]
Meter=String
FontColor=0,0,0,255
FontSize=16
x=1
y=1
Background=2
SolidColor=255,0,0,255
Text=BGC is Dark:  #BGC#, TFC Is Light: #TFC#
Hidden=1
DynamicVariables=1


[TFCLight]
Meter=String
FontColor=0,0,0,255
FontSize=16
x=1
y=1
Background=2
SolidColor=255,0,0,255
Text=BGC isLight:  #BGC#, TFC Is Dark:  #TFC#
Hidden=1
DynamicVariables=1
It correctly measures the background color variable (BGC), you have previously set in [Variables], and determines the font color variable (TFC) as 'white' or 'black'.

But, you never use the #BGC# or the #TFC# variables in any of your string meters in any of your skins. So even with this working, you will not see any change because the variables are not used...

This will allow you to set 1 font color based on 1 background color.

But you have 4 color settings skins with options to set 75~100 different color backgrounds; you would need to test every background choice, and have a unique font color variable for every one of them.

It's your decision, but I do not foresee a simple solution.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Automatic Color Change.

Post by bill98 »

Thanks for your expert help and time. One more question. I am not sure exactly what you mean by "having a unique font color variable for each one." I had previously changed the code in an attempt to do something similar to this. Does this meet your requirement? Revised meters from RGBScr1.ini. If not please specify exactly what you mean. Thank You.


[MeterChangeBorderColor]
Meter=String
MouseOverAction=[!WriteKeyValue Variables BGC #TitleBDR# "#@#VariablesM2.inc"][!ReFresh][!ActivateConfig "PGMLauncher\RGBLD" "RGBTLD.ini"]
X=-40r
Y=10R
W=270
H=20
FontSize=12
FontColor=#TFC#
StringStyle=Italic
SolidColor=#TitleBDR#
Padding=3,3,0,0
AntiAlias=1
Text=Name Border #TitleBDR##CRLF##BGC# #TitleBDR#
LeftMouseUpAction=["#@#Addons\RainRGB\RainRGB4.exe" "VarName=TitleBDR" "FileName=#@#Scheme#CSNO#.inc" "RefreshConfig=#CURRENTCONFIG#"][!DeActivateConfig "PGMLauncher\RGBLD" "RGBTLD.ini"]

[MeterChangeBackgroundColor]
Meter=String
MouseOverAction=[!WriteKeyValue Variables BGC #TitleBG2# "#@#VariablesM2.inc"][!ActivateConfig "PGMLauncher\RGBLD" "RGBTLD.ini"]
X=r
Y=R
W=270
H=70
FontSize=12
DynamicVariables=1
FontColor=#TFC#
StringStyle=Italic
SolidColor=#TitleBG2#
Padding=3,3,0,0
AntiAlias=1
Text=Background #TitleBG2#
LeftMouseUpAction=["#@#Addons\RainRGB\RainRGB4.exe" "VarName=TitleBG2" "FileName=#@#Scheme#CSNO#.inc" "RefreshConfig=#CURRENTCONFIG#"][!DeActivateConfig "PGMLauncher\RGBLD" "RGBTLD.ini"]
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Automatic Color Change.

Post by eclectic-tech »

AND there was 1 more typo in RGBLTD... (I missed that one)

The 'IfFalseAction=' in [MeasureColor] was missing a quatation mark, so the new TFC color was never changed to white.
IfFalseAction=[!WriteKeyValue Variables TFC "255,255,255" "#@#VariablesM2.inc"][!SetVariable TFC "255,255,255"][!ShowMeter TFCDark]

Use the !About Log to help you fix problems... I found this by looking at !About (Log), it reported an invalid path during execution.

Lastly, I had to change your MouseOverAction by doing [!Refresh *]:
MouseOverAction=[!WriteKeyValue Variables BGC #TitleBDR# "#@#VariablesM2.inc"][!Refresh *][!ActivateConfig "PGMLauncher\RGBLD" "RGBTLD.ini"]

-=-
I would suggest a different approach to your settings skins. With these corrections, the text will change when you click/hover (actually the text color on every meter will change..).
Now others may have the same text color as their background, so you cannot see them.
It is a vicious circle...

Separate the settings name from the background color; two separate meters. So you get something like this:
Image
This is more involved than what you need, you can have 1 settings and 1 color square.

Again, this is your project, but this process may need to be simplified. Rather than changing the font color on every mouse over, on every meter, and constantly refreshing skins... just separate the color choice from the setting name.

Aside: I sent you a PM (private message) a day ago or two, but have not heard back?
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Automatic Color Change.

Post by bill98 »

Several questions:

1. Not sure we are using the exact skins anymore. Want me to send you mine once more or vice versa?

2. Do you think it would be better to change the #@#Scheme1.inc format to:
Var Name11=145 (Red)
Var Name12=086 (Green)
Var Name13=200 (Blue)
Var Name14=255
Var Name21=
Var Name22=
Var Name23=
Var Name24=
etc.

Do you have a better idea to accomplish helping the user change the colors?
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Automatic Color Change.

Post by bill98 »

Here is the missing figure. It won't upload the figure. I'll copy it to a portable drive and try to send it from California on my Android tablet.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Automatic Color Change.

Post by eclectic-tech »

bill98 wrote:Here is the missing figure. It won't upload the figure. I'll copy it to a portable drive and try to send it from California on my Android tablet.
I think I already have it from an earlier post... send if you want, but I am thinking it might be easier just to use string meters, rather than an image.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: Automatic Color Change.

Post by bill98 »

I can't connect the USB stick to my tablet anyway. I need a female USB connector. Maybe I buy a cable somewhere. Let me know if you need it. How can you use only string meters and get user inputs? We made it here after a long day
Leon James
Posts: 1
Joined: February 19th, 2017, 5:55 pm

Re: Automatic Color Change.

Post by Leon James »

hy guyzz......i need to change the border colour automatically.....please help me to change its colour.....i dont know the codding of the skins.......
this is the skin code:
[Rainmeter]
Author=Media Maggot | Daelnz

[Metadata]
Name=Border
Information=Border Image in 1366 x 768
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.1.0

[MeterBackground]
Meter=image
Imagename=border 1366x768.png
Antialias=1
Position=On Desktop