I would like to render a drawing with white->black and black->white but leave all the other colors as is. Is that possible?
I tried bgcolor=#FFFFFF fgcolor=#000000 properties, but that removed all color from the drawing.
I'll answer my own question.
fgcolor=acihighinverse bgcolor=#FFFFFF works perfectly!
The palette manipulation is handled in YxxfGfxPalette.java.
The "acihighinverse" palette was added for printing. The "aci" stands for "AutoCAD Color Index". It is the standard 255 ACAD palette with 0=BYBLOCK and 256=BYLAYER. The acihighinverse is a modification of aci done with this bit of code:
// For each color index from 1 to 255
if (r >= 192 && g >= 192 && b >= 192)
new Color(255 - r, 255 - g, 255 - b);
This examines each color and if it is "light" or sort of near white it inverts it and makes it dark. This was somewhat arbitrary on my part but it seems to work well for printing on a white background.
Log in to post a comment.