I have successfully added a color-shift to the battery-widget.
I have successfully added a color-shift to the battery-widget. It turns from a green when full to a red when empty. I am happy with the result, but my code feels hacky.
The 16 added keeps it from becoming single digit.
Please tell me, this is not the “best practice” way to do it. 😉
So i can add this script to the wiki.
]]>« Pierre Hébert (Previous Post)
(Next Post) Pierre Hébert very special bug report: If you create a shortcut in LL, LL saves the intent for this shortcut, but… »
< ![CDATA[
A bit easier: Color.rgb(r,g,b)
]]>
< ![CDATA[
So, in your case: p.setColor(Color.rgb(255-2.55*batperc,2.55*patperc,0));
]]>
< ![CDATA[
How, could I mis that one. Thanks.
]]>
< ![CDATA[
Maybe you missed it because it’s Java, not javascript 😉
]]>
< ![CDATA[
That’s lime green, not green. Green is darker.
]]>
< ![CDATA[
Oops, sorry. Corrected
]]>