It is currently February 29th, 2024, 7:30 pm

[Solved]Color Change Help Needed

Get help with creating, editing & fixing problems with skins
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

[Solved]Color Change Help Needed

Post by Aarowaim »

I'm making a modification to Sierro Majere's Rainmeter Skin, Lanettes PC http://www.customize.org/rainmeter/skins/73003 That will change the color of the bars according to RAM/CPU usage values and have set it up according to http://rainmeter.net/forum/viewtopic.php?f=15&t=3335. With the .ini below, it links to my variable sheet successfully (I know because the pokemon overlay works, but It only displays in yellow (the color specified in the variable sheet) when I only complete the first step of that guide and when I complete the second step properly (like below), It shows 100 Ram and a full meter in yellow. What mistake am I making?
Here is my .ini for the RAM counter with the change variable color commands in the color that they are supposed to become (Color2 is 60,60,60,0).
[Variables]
@include="#SKINSPATH#Lanettes PC\Custom Pokémon.inc"

[Rainmeter]
DynamicWindowSize=1
[Variables]Color1=255, 219, 74, 255
Color2=60,60,60,0

;[GATHER MEMORY]==================================

[MeasurePhysMemTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=2

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasurePhysMemFree]
Measure=PhysicalMemory
InvertMeasure=1
UpdateDivider=2

[MeasureMemory%]
Measure=Calc
Formula=ROUND(100 - ((MeasurePhysMemFree / (MeasurePhysMemTotal + 1)) * 100))MinValue=0MaxValue=100
IfAboveValue=49
IfAboveAction=!Execute [!RainmeterSetVariable Color1 112,248,168,255][!RainmeterRedraw]
IfBelowValue=50
IfBelowAction=!Execute [!RainmeterSetVariable Color1 222,73,66,255][!RainmeterRedraw]

[RAMDelay]
Measure=Calc
Formula=MeasureRAM

[MeterBackground]
Meter=Image
ImageName=RAM.png

[MeterPokemonOverlay]
Meter=Image
X=0
Y=-19
H=64
W=64
ImageName=#RAMPokemon#

[MeterRAMBar]
Meter=Bar
MeasureName=MeasureMemory%
X=190
Y=16
W=96
H=6
BarColor=#Color1#
BarOrientation=HORIZONTAL
DynamicVariables=1

[MeterRAMNumber]
Meter=String
Measurename=MeasureMemory%
Meter=STRING
X=224
Y=25
FontColor=248,248,248,255
FontFace="Power Green Small"
FontSize=12
StringEffect=Shadow
FontEffectColor=112,112,112,255
AntiAlias=1
Align=Right

[MeterRAMTotal]
Meter=String
X=5R
Y=25
FontColor=248,248,248,255
FontFace="Power Green Small"
FontSize=12
StringEffect=Shadow
FontEffectColor=112,112,112,255
AntiAlias=1
Text="/ 100"



[MeterRAMTotal]
Meter=String
Text=/ 100
X=246
Y=25
FontColor=248,248,248,255
FontFace="Power Green Small"
FontSize=12
StringEffect=Shadow
FontEffectColor=112,112,112,255
AntiAlias=1

Code: Select all

[Variables]
Color1=255, 219, 74, 255
Color2=60,60,60,0
Last edited by Aarowaim on August 12th, 2010, 9:39 pm, edited 5 times in total.
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]
User avatar
jsmorley
Developer
Posts: 22625
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Color Change Help Needed

Post by jsmorley »

Here is that .ini I talked about in irc that will give you the values you need to dynamically change that bar:

There are some positioning issues and such that I didn't mess with as I don't have the images from your include file, but this will properly display a bar with the percentage of free memory and change the color as it should.

Code: Select all

[Rainmeter]
DynamicWindowSize=1

[Variables]
Color1=255, 219, 74, 255
Color2=60,60,60,0

;[GATHER MEMORY]==================================

[MeasurePhysMemTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=2

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasurePhysMemFree]
Measure=PhysicalMemory
InvertMeasure=1
UpdateDivider=2

[MeasureMemory%]
Measure=Calc
Formula=ROUND(100 - ((MeasurePhysMemFree / (MeasurePhysMemTotal + 1)) * 100))
MinValue=0
MaxValue=100
IfAboveValue=39
IfAboveAction=!Execute [!RainmeterSetVariable Color1 112,248,168,255][!RainmeterRedraw]
IfBelowValue=40
IfBelowAction=!Execute [!RainmeterSetVariable Color1 222,73,66,255][!RainmeterRedraw]

[RAMDelay]
Measure=Calc
Formula=MeasureRAM

[MeterBackground]
Meter=Image
ImageName=RAM.png

[MeterPokemonOverlay]
Meter=Image
X=0
Y=-19
H=64
W=64
ImageName=#RAMPokemon#

[MeterRAMBar]
Meter=Bar
MeasureName=MeasureMemory%
X=190
Y=16
W=96
H=6
BarColor=#Color1#
BarOrientation=HORIZONTAL
DynamicVariables=1

[MeterRAMNumber]
Meter=String
Measurename=MeasureMemory%
Meter=STRING
X=224
Y=25
FontColor=248,248,248,255
FontFace="Power Green Small"
FontSize=12
StringEffect=Shadow
FontEffectColor=112,112,112,255
AntiAlias=1
Align=Right

[MeterRAMTotal]
Meter=String
X=5R
Y=25
FontColor=248,248,248,255
FontFace="Power Green Small"
FontSize=12
StringEffect=Shadow
FontEffectColor=112,112,112,255
AntiAlias=1
Text="/ 100"
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

Re: Color Change Help Needed

Post by Aarowaim »

It's working 100% Thanks for your time jsmorley :D
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]
User avatar
jsmorley
Developer
Posts: 22625
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Color Change Help Needed

Post by jsmorley »

Aarowaim wrote:It's working 100% Thanks for your time jsmorley :D
My pleasure.
Aarowaim
Posts: 97
Joined: July 25th, 2010, 7:23 am

Re: Color Change Help Needed

Post by Aarowaim »

I managed to get it to work with three colors! rather than being yellow or green, I made it so that it is more like the real pokemon hp bars (Red when below 26%, Yellow between 26-49%, and green above 49%) I achieved this by "overlapping" two bars that read different versions of the equation. One displays 50% and up, but if the value goes below 50, it displays the second bar which shows yellow unless the value drops below 26%, in which case, it displays red. If the value equals 26 at any point, which it must in order to go higher, it re-displays yellow and if the value goes above 49, it switches back to the first bar. Basicly, I combined to bars that do this:
Bar 1= if above 49 show green, if below 50, display Bar 2
Bar 2= if above 49 show Bar 1, if equal to 26 at any point show yellow, if below 26 show red

Here is the code that achieved this feat:

Code: Select all

[Rainmeter]
DynamicVariables=1

[Variables]
Color1=255, 219, 74, 255


;[GATHER MEMORY]==================================

[MeasurePhysMemTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=2

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasurePhysMemFree]
Measure=PhysicalMemory
InvertMeasure=0
UpdateDivider=2

[MeasureMemory1]
Measure=Calc
Formula=ROUND(100 - ((MeasurePhysMemFree / (MeasurePhysMemTotal + 1)) * 100))
MinValue=0
MaxValue=100
IfAboveValue=49
IfAboveAction=!Execute [!RainmeterSetVariable Color1 255,219,74,255][!RainmeterHideMeter MeterRAMLowBar][!RainmeterShowMeter MeterRAMHighBar][!RainmeterRedraw]
IfEqualValue=26
IfEqualAction=[!RainmeterSetVariable Color1 255,219,74,255][!RainmeterRedraw]
IfBelowValue=26
IfBelowAction=!Execute [!RainmeterSetVariable Color1 222,73,66,255][!RainmeterRedraw]

[MeasureMemory2]
Measure=Calc
Formula=ROUND(100 - ((MeasurePhysMemFree / (MeasurePhysMemTotal + 1)) * 100))
MinValue=0
MaxValue=100
IfAboveValue=49
IfAboveAction=!Execute [!RainmeterSetVariable Color1 112,248,168,255][!RainmeterRedraw]
IfBelowValue=50
IfBelowAction=!Execute [!RainmeterSetVariable Color1 255,219,74,255][!RainmeterHideMeter MeterRAMHighBar][!RainmeterShowMeter MeterRAMLowBar][!RainmeterRedraw]

[MeterRAMHighBar]
Meter=Bar
MeasureName=MeasureMemory2
X=190
Y=16
W=96
H=6
BarColor=#Color1#
BarOrientation=HORIZONTAL
DynamicVariables=1

[MeterRAMLowBar]
Meter=Bar
MeasureName=MeasureMemory1
X=190
Y=16
W=96
H=6
BarColor=#Color1#
BarOrientation=HORIZONTAL
DynamicVariables=1
Away for a while :(
Programming isn't a hobby, it's a lifestyle choice.
[url=http://www.rainmeter.net/forum/viewtopic.php?f=83&t=1207][b]T34M V.1.5.0.|2[/b][/url] <----I'ts l33t, look it up

Coding Skills: [color=#00FFFF]4.5[/color]
Answering Skills: [color=#00FFFF]4[/color]
Image Editing: [color=#00FFFF]3[/color]
Knowledge: [color=#00FFFF]4.5[/color]
Technical Skills: [color=#00FFFF]3[/color]