It is currently July 14th, 2020, 8:41 pm

Hex color variable not working

Help with creating, editing & fixing problems with skins
dooey123
Posts: 8
Joined: May 5th, 2019, 1:04 pm

Hex color variable not working

Post by dooey123 »

I have a hex color variable whose value is " 9fccff ". I know the value being parsed is correct:

Image

If I replace variable sky12=9fccff it works and I get the correct color but sky12=MeasureSky12 doesn't, I just get white.

Code: Select all


;measure
[MeasureSky12]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureTimes]
StringIndex=25

;variable
sky12=MeasureSky12

;meter
[meterDot12]
Meter=Bar
X=0
Y=0
W=30
H=30
SolidColor=#sky12#
Help appreciated, thanks.
User avatar
jsmorley
Developer
Posts: 21024
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Hex color variable not working

Post by jsmorley »

There are a couple of ways of coming at this:

Code: Select all

[Variables]
sky12=[MeasureSky12]

;measure
[MeasureSky12]
Measure=WebParser
Url=[MeasureTimes]
StringIndex=25

;meter
[meterDot12]
Meter=Bar
X=0
Y=0
W=30
H=30
SolidColor=#sky12#
DynamicVariables=1

Code: Select all

;measure
[MeasureSky12]
Measure=WebParser
Url=[MeasureTimes]
StringIndex=25

;meter
[meterDot12]
Meter=Bar
X=0
Y=0
W=30
H=30
SolidColor=[MeasureSky12]
DynamicVariables=1
This is never going to work:

;variable
sky12=MeasureSky12

Since that is just setting the value of the variable sky12 to the literal text "MeasureSky12".
dooey123
Posts: 8
Joined: May 5th, 2019, 1:04 pm

Re: Hex color variable not working

Post by dooey123 »

Thank you very much
dooey123
Posts: 8
Joined: May 5th, 2019, 1:04 pm

Re: Hex color variable not working

Post by dooey123 »

After coming back to this to try and integrate the changes into the main file it has stopped working again and I cannot for the life of me understand why.
Webparser gives correct value:
Image

Code: Select all

[Sky12]
Measure=WebParser
Url=[MeasureSkyCol]
StringIndex=1
DynamicVariables=1

[MeterShape1]
Meter=Shape
Shape=Rectangle 0,0,100,50 | Fill Color [Sky12]
again I just get a white shape meter instead of the 71c2ff blue color.
dooey123
Posts: 8
Joined: May 5th, 2019, 1:04 pm

Re: Hex color variable not working

Post by dooey123 »

sorry forget previous post, I needed to add DynamicVariables=1

works now!