Class AcadColor

java.lang.Object
org.gvsig.dwg.lib.util.AcadColor

public class AcadColor extends Object
This class allows to convert Autocad colors in Java colors
Author:
jmorell
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    When Autocad color is 0, then the color of the object is the color of the block where it is placed
    static final int
    When Autocad color is 256, then the color of the object is the color of it layer
  • Constructor Summary

    Constructors
    Constructor
    Description
    AcadColor(int code, double r0, double g0, double b0, double r, double g, double b)
    This method is used to build the Autocad color table
  • Method Summary

    Modifier and Type
    Method
    Description
    static Color
    getColor(int code)
    This method uses Autocad color table for convert a color in the Autocad color code in a java Color
    static AcadColor[]
    Initialize an Autocad color table

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BYLAYER

      public static final int BYLAYER
      When Autocad color is 256, then the color of the object is the color of it layer
      See Also:
    • BYBLOCK

      public static final int BYBLOCK
      When Autocad color is 0, then the color of the object is the color of the block where it is placed
      See Also:
  • Constructor Details

    • AcadColor

      public AcadColor(int code, double r0, double g0, double b0, double r, double g, double b)
      This method is used to build the Autocad color table
      Parameters:
      code - Code is the Autocad color number
      r0 - r0 is the red component (0-1)
      g0 - g0 is the green component (0-1)
      b0 - b0 is the blue component (0-1)
      r - r0 is the red component (0-255)
      g - g0 is the green component (0-255)
      b - b0 is the blue component (0-255)
  • Method Details

    • getColor

      public static Color getColor(int code)
      This method uses Autocad color table for convert a color in the Autocad color code in a java Color
      Parameters:
      code - This int is the Autocad color number
      Returns:
      Color Java Color corresponding to the Autocad color number argument
    • initTable

      public static AcadColor[] initTable()
      Initialize an Autocad color table
      Returns:
      AcadColor[] Object of this class that represents Acad color to Java color conversion