Villem,
Currently changing the color of text can only be done using Java Beans. We include an example in our RedNegative.java Bean example. The link to this example and wiki article is located is here: http://ohana.windward.net/Wiki/tabid/57/topic/Using%20beans%20in%20your%20template/Default.aspx
You can see that once the bean is setup it is just a matter of setting result.setColor(Color.NAMEOFCOLOR) after you have stored the text in result.
private BeanResult display(String value, String type, String pattern, Locale locale) throws BeanProviderException {
// set up to draw in black and revert to the original formatting after the value is written
BeanResult result = new BeanResult(value);
result.fontColor = Color.black;
result.resetBack = true;
// if no node, that is not an error
if (value == null)
return result;
// the number could be formatted - get the raw number and see if it is negative.
try {
String rawText = StringTagFormatter.dataToRaw(value, type, pattern, locale);
if ((rawText == null) || (rawText.length() == 0))
return result;
double num = Double.parseDouble(rawText);
if (num < 0.0)
result.setColor(Color.red);
} catch (Exception ex) {
throw new BeanProviderException(value + " is not a number", ex);
}
return result;
--Ryan