Mark Anderson
YaBB Administrator
Offline
Wiki Gardeners
Posts: 1709
Southsea, UK
|
Here's a stab at the hue issue, you'll need a custom colour attribute and this rule:
$MyColor=rgb(201,102,102);if($MyProgress<33){$Color2=$MyColor};if(($MyProgress>3 3)&($MyProgress<67)){$Color2=hue($MyColor,200)};if($MyProgress>67){$Color2=hue($ MyColor,150)};$Pattern="bar($MyProgress)";
Breaking out the individual terms out a bit onto separate lines we get:
$MyColor=rgb(201,102,102); if($MyProgress<33){$Color2=$MyColor}; if(($MyProgress>33)&($MyProgress<67)){$Color2=hue($MyColor,200)}; if($MyProgress>67){$Color2=hue($MyColor,150)}; $Pattern="bar($MyProgress)";
So, how does it work? First, we define a colour,$MyColor, that we won't modify further but rather use it as a reference to make hue-shifted colours from that we apply to $Color2 which draws the progress bar. Depending on the value of $ProgressBar, $Color2 is changed In the above example, below 33% complete the fill colour is red, 33%-67% it is blue and above 67% it is green. Play with the base colour and hue offsets to get different colour combos. Clearly, if you want more variation in colour, you'll need more 'if' clauses.
One thing I do note is that despite setting $Pattern last in the Rule, when I change $MyProgress the bar updates immediately but $Color2 does not - it appears to wait until the next agent/action/rule update cycle. That strikes me as unexpected but it's probably flaky syntax on my part rather than an error in TB's rule resolution.
|