Killfile Novice
Joined: 30 Sep 2002 Posts: 32 Location: USA
|
Posted: Mon Feb 03, 2003 2:18 pm
Color Function |
It's not terribly innovative, but this function takes makes color ranges much easier to read than a series of chained if statements and %ansi functions.
#VAR ColorScale10 {%ansi( high, cyan)%if( %1 < %2, %ansi( high, yellow))%if( %1 < (%eval( .75 * %2)), %ansi( high, green))%if( %1 < (%eval( .50 * %2)), %ansi( high, blue))%if( %1 < (%eval( .25 * %2)), %ansi( high, red))%format( "&10.0n", %1)%ansi( green)} {_nodef} "Services"
Usage is as follows @ColorScale(@Variable,MaxForVar)
Where MaxForVar is an integer representing the "Perfect" value for the variable you're tracking. My scale deals with number up to 10 digits, but you can change that easily.
At "perfect" the number will be displayed with comas etc in Cyan
Above 75% it will be displayed in yellow
Above 50% in green
Above 25% in blue
And below 25% in red.
Warning: Using a lot of these in your status window causes older processors some problems due to the continuous update nature of the STW.
--Killfile |
|