- attr.setForeColor(attr.getForeColor().invert());
- attr.setBackColor(attr.getBackColor().invert());
+ if (attr.getForeColorRGB() < 0) {
+ attr.setForeColor(attr.getForeColor().invert());
+ } else {
+ attr.setForeColorRGB(attr.getForeColorRGB() ^ 0x00ffffff);
+ }
+ if (attr.getBackColorRGB() < 0) {
+ attr.setBackColor(attr.getBackColor().invert());
+ } else {
+ attr.setBackColorRGB(attr.getBackColorRGB() ^ 0x00ffffff);
+ }