Frage

When colorizing numbers (black for positive numbers, red for negative numbers), I usually use this snippet:

style.setDataFormat(format.getFormat("[Green]#,##0;[Red]#,##0"));

Ive seen some variation like this one below but Im not sure what COLOR 5 means.

"[BLACK]0.00;[COLOR 5]##.##"

What I would like to know is, what colors are suported for these color descriptors and if it is possible to provide a hex value instead? (Ive tried it, didnt work so maybe Im doing it incorrectly).

War es hilfreich?

Lösung

I believe at least values listed in org.apache.poi.ss.usermodel.IndexedColors should be supported. They also should be backward compatible with older versions of Excel.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top