hi, im new to the forum. i got to thinking about changing the color of iron man JARVIS theme in relation to how much battery i have left. here are the specifics in java code:
if(battery = plugin)
{
skin = blue
}
if(battery = !plugin)
{
if(battery = 100%)
{
skin = green
}
if(battery <= 50%)
{
skin = yellow
}
if(battery <= 10%)
{
skin = red
}
}
any help is appreciated, and java is the only code i know.
It is currently August 26th, 2024, 3:06 am
changing JARVIS color
-
- Posts: 2
- Joined: March 22nd, 2013, 1:36 am
-
- Posts: 1175
- Joined: June 9th, 2010, 5:56 pm
- Location: Locks heath, UK
Re: changing JARVIS color
No Java here, however there are several ways to do this and Surfier's makes sense to my tiny brain... ![Sly :sly:](./images/smilies/do.gif)
![Sly :sly:](./images/smilies/do.gif)
-
- Posts: 2
- Joined: March 22nd, 2013, 1:36 am
Re: changing JARVIS color
well, what i'm actually looking for is a direct translation, the theme in question comes pre-packaged with 4 colors: blue, green, yellow, red. i'm trying to get what i want without deleting previously existing skins, without adding a battery skin, and (as i mentioned earlier) tie in to the battery status. can anyone give me the right code, in some translation of my 1st post?
-
- Posts: 65
- Joined: January 31st, 2013, 5:28 pm
Re: changing JARVIS color
Code: Select all
[measureBATT]
UpDateDivider=2
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=PERCENT
Code: Select all
[colorBAR]
measure=calc
formula=(measureBATT < 15) ? -7 : ((measureBATT < 25) ? -6 : ((measureBATT < 40) ? -5 : ((measureBATT < 50) ? -4 : ((measureBATT < 80) ? -3 : ((measureBATT < 90) ? -2 : -1)))))
Substitute="-1" : "00FF00" , "-2" : "73FF00" , "-3" : "C8FF00" , "-4" : "FFFF00" , "-5" : "FFBC00" , "-6" : "FF5C00" , "-7" : "FF0000"
what this "formula" does is compare [measureBATT] <which is a percentage from 0 to 100>....to a set of criteria...using the condition funtion "?" and "true : false"
so my line:
formula=(measureBATT < 15) ? -7 : ((measureBATT < 25) ? -6 : ((measureBATT < 40) ? -5 : ((measureBATT < 50) ? -4 : ((measureBATT < 80) ? -3 : ((measureBATT < 90) ? -2 : -1)))))
would translate to:
IF measureBATT < 15
THEN = -7
ELSE
IF measureBATT < 25
THEN = -6
ELSE
IF measureBATT <40
etc...etc...etc....etc....
The next line:
Substitute="-1" : "00FF00" , "-2" : "73FF00" , "-3" : "C8FF00" , "-4" : "FFFF00" , "-5" : "FFBC00" , "-6" : "FF5C00" , "-7" : "FF0000"
simple swaps one value for another....in this case the number generated by the above line, into a color code.....