Help save net neutrality! Learn more.
Close

Colors in drawings

2003-04-29
2003-04-30
  • Jared Davis

    Jared Davis - 2003-04-29

    Hi,

    Great program!

    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.

     
    • Jared Davis

      Jared Davis - 2003-04-29

      I'll answer my own question.

      fgcolor=acihighinverse bgcolor=#FFFFFF works perfectly!

       
    • Ed Karlo

      Ed Karlo - 2003-04-30

      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)
        jcolorarr_acihighinverse[i] =
            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.