Class DXFColor


  • public class DXFColor
    extends java.lang.Object
    Class providing static methods for handling colors of entities in DXF file. Colors are represented by an index into a table, rather than RGB triples. The methods of this class help to find the match in the table for a specified RGB color so that the table index can be used in the entity definition.
    Author:
    jsevy
    • Constructor Summary

      Constructors 
      Constructor Description
      DXFColor()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getClosestDXFColor​(int rgbColor)
      Find the closest match for a given RGB color in the standard DXF color table.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DXFColor

        public DXFColor()
    • Method Detail

      • getClosestDXFColor

        public static int getClosestDXFColor​(int rgbColor)
        Find the closest match for a given RGB color in the standard DXF color table. The best match is selected on the basis of minimum distance using R, G and B asaxes.
        Parameters:
        rgbColor - The RGB color for which a match is desired, represented as a standard Java argb color (alpha is ignored)
        Returns:
        The standard DXF color table index for the color that is the closest match to that supplied