Package com.jsevy.jdxf
Class DXFColor
- java.lang.Object
-
- com.jsevy.jdxf.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
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLOR_BYBLOCK
static int
COLOR_BYLAYER
-
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.
-
-
-
Field Detail
-
COLOR_BYBLOCK
public static final int COLOR_BYBLOCK
- See Also:
- Constant Field Values
-
COLOR_BYLAYER
public static final int COLOR_BYLAYER
- See Also:
- Constant Field Values
-
-
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
-
-