Class JaxoColor
java.lang.Object
net.sf.jaxodraw.util.JaxoColor
Definitions and conversions for the colors of the LaTeX
colordvi package (approximately) and a predefined set of
gray shades.- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAny Color can be chosen.static final ColorThe color Apricot.static final ColorThe color Aquamarine.static final ColorThe color Bittersweet.static final ColorThe color Black.static final ColorThe color Blue.static final ColorThe color BlueGreen.static final ColorThe color BlueViolet.static final ColorThe color BrickRed.static final ColorThe color Brown.static final ColorThe color BurntOrange.static final ColorThe color CadetBlue.static final ColorThe color CarnationPink.static final ColorThe color Cerulean.static final ColorThe color CornflowerBlue.static final ColorThe color Cyan.static final ColorThe color Dandelion.static final ColorThe color DarkOrchid.static final ColorThe color Emerald.static final ColorThe color ForestGreen.static final ColorThe color Fuchsia.static final ColorThe color Goldenrod.static final ColorThe color Gray.static final ColorThe color GrayScale105.static final ColorThe color GrayScale120.static final ColorThe color GrayScale135.static final ColorThe color GrayScale15.static final ColorThe color GrayScale150.static final ColorThe color GrayScale165.static final ColorThe color GrayScale180.static final ColorThe color GrayScale195.static final ColorThe color GrayScale210.static final ColorThe color GrayScale225.static final ColorThe color GrayScale240.static final ColorThe color GrayScale30.static final ColorThe color GrayScale45.static final ColorThe color GrayScale60.static final ColorThe color GrayScale75.static final ColorThe color GrayScale90.static final ColorThe color Green.static final ColorThe color GreenYellow.static final intAll Colors defined in JaxoColor can be chosen.static final intColors defined in JaxoColor except grayscales can be chosen.static final ColorThe color JungleGreen.static final ColorThe color Lavender.static final ColorThe color LimeGreen.static final ColorThe color Magenta.static final ColorThe color Mahagony.static final ColorThe color Maroon.static final ColorThe color Melon.static final ColorThe color MidnightBlue.static final ColorThe color Mulberry.static final ColorThe color NavyBlue.static final ColorThe color OliveGreen.static final ColorThe color Orange.static final ColorThe color OrangeRed.static final ColorThe color Orchid.static final ColorThe color Peach.static final ColorThe color Periwinkle.static final ColorThe color PineGreen.static final ColorThe color Plum.static final ColorThe color ProcessBlue.static final ColorThe color Purple.static final ColorThe color RawSienna.static final ColorThe color Red.static final ColorThe color RedOrange.static final ColorThe color RedViolet.static final ColorThe color Rhodamine.static final ColorThe color RoyalBlue.static final ColorThe color RoyalPurple.static final ColorThe color RubineRed.static final ColorThe color Salmon.static final ColorThe color SeaGreen.static final ColorThe color Sepia.static final ColorThe color SkyBlue.static final ColorThe color SpringGreen.static final ColorThe color Tan.static final ColorThe color TealBlue.static final ColorThe color Thistle.static final ColorThe color Turquoise.static final ColorThe color Violet.static final ColorThe color VioletRed.static final ColorThe color White.static final ColorThe color WildStrawberry.static final ColorThe color Yellow.static final ColorThe color YellowGreen.static final ColorThe color YellowOrange. -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorgetClosestColorTo(Color refcolor, int mode) Return the Color closest (in the specified mode) to the given color.static ColorgetColor(int i) Returns the color at index i of the colorList.static ColorReturns the color corresponding to the name cName, or the default color if none.static ColorReturns the color corresponding to the name cName, or the default color if none.static intReturns the number of colors defined by JaxoColor.static StringgetColorName(int i) Returns the name of the color at index i in the colorList.static StringgetColorName(Color color) Returns the name of the closest defined color to 'color'.static StringgetColorName(Color color, int space) Returns the name of the closest defined color (in the mode) color.static ColorReturns the current default color.static ColorgetDefaultFillColor(Color lineColor) Returns the current default fill color for the given line color.static ColorgetGrayScaleColor(float f) Returns the grayscale that corresponds to the float value f.static floatgetGrayScaleFloat(Color color) Returns a string representation of a Color that gives the grayscale of color, or sets it to '0.0' (black), if color is not a grayscale.static StringgetLatexColorCommand(Color color) Returns a String containing the LaTex color command (as used by the package colordvi) to set the color.static booleanisDefinedColor(Color color) Checks whether the given color is a defined Color.static booleanisDefinedColor(Color color, int mode) Checks whether the given color is a defined Color in the given mode.static booleanisDefinedColorName(String cName) Checks whether the given name is for a defined Color.static booleanisDefinedColorName(String cName, int mode) Checks whether the given name is for a Color defined in the given mode.static booleanisGrayScale(Color color) Checks whether the 'color' is closest to one of the gray scales defined in this class.
-
Field Details
-
JAXO_COLORS_MODE
public static final int JAXO_COLORS_MODEAll Colors defined in JaxoColor can be chosen.- See Also:
-
JAXO_COLORS_NO_GRAYSCALES_MODE
public static final int JAXO_COLORS_NO_GRAYSCALES_MODEColors defined in JaxoColor except grayscales can be chosen.- See Also:
-
ALL_COLORS_MODE
public static final int ALL_COLORS_MODEAny Color can be chosen.- See Also:
-
GREEN_YELLOW
The color GreenYellow. -
YELLOW
The color Yellow. -
GOLDEN_ROD
The color Goldenrod. -
DANDELION
The color Dandelion. -
APRICOT
The color Apricot. -
PEACH
The color Peach. -
MELON
The color Melon. -
YELLOW_ORANGE
The color YellowOrange. -
ORANGE
The color Orange. -
BURNT_ORANGE
The color BurntOrange. -
BITTERSWEET
The color Bittersweet. -
RED_ORANGE
The color RedOrange. -
MAHOGANY
The color Mahagony. -
MAROON
The color Maroon. -
BRICK_RED
The color BrickRed. -
RED
The color Red. -
ORANGE_RED
The color OrangeRed. -
RUBINE_RED
The color RubineRed. -
WILDSTRAWBERRY
The color WildStrawberry. -
SALMON
The color Salmon. -
CARNATION_PINK
The color CarnationPink. -
MAGENTA
The color Magenta. -
VIOLET_RED
The color VioletRed. -
RHODAMINE
The color Rhodamine. -
MULBERRY
The color Mulberry. -
RED_VIOLET
The color RedViolet. -
FUCHSIA
The color Fuchsia. -
LAVENDER
The color Lavender. -
THISTLE
The color Thistle. -
ORCHID
The color Orchid. -
DARK_ORCHID
The color DarkOrchid. -
PURPLE
The color Purple. -
PLUM
The color Plum. -
VIOLET
The color Violet. -
ROYAL_PURPLE
The color RoyalPurple. -
BLUE_VIOLET
The color BlueViolet. -
PERIWINKLE
The color Periwinkle. -
CADET_BLUE
The color CadetBlue. -
CORNFLOWER_BLUE
The color CornflowerBlue. -
MIDNIGHT_BLUE
The color MidnightBlue. -
NAVY_BLUE
The color NavyBlue. -
ROYAL_BLUE
The color RoyalBlue. -
BLUE
The color Blue. -
CERULEAN
The color Cerulean. -
CYAN
The color Cyan. -
PROCESS_BLUE
The color ProcessBlue. -
SKY_BLUE
The color SkyBlue. -
TURQUOISE
The color Turquoise. -
TEAL_BLUE
The color TealBlue. -
AQUAMARINE
The color Aquamarine. -
BLUE_GREEN
The color BlueGreen. -
EMERALD
The color Emerald. -
JUNGLE_GREEN
The color JungleGreen. -
SEA_GREEN
The color SeaGreen. -
GREEN
The color Green. -
FOREST_GREEN
The color ForestGreen. -
PINE_GREEN
The color PineGreen. -
LIME_GREEN
The color LimeGreen. -
YELLOW_GREEN
The color YellowGreen. -
SPRING_GREEN
The color SpringGreen. -
OLIVE_GREEN
The color OliveGreen. -
RAWSIENNA
The color RawSienna. -
SEPIA
The color Sepia. -
BROWN
The color Brown. -
TAN
The color Tan. -
GRAY
The color Gray. -
BLACK
The color Black. -
GRAYSCALE15
The color GrayScale15. -
GRAYSCALE30
The color GrayScale30. -
GRAYSCALE45
The color GrayScale45. -
GRAYSCALE60
The color GrayScale60. -
GRAYSCALE75
The color GrayScale75. -
GRAYSCALE90
The color GrayScale90. -
GRAYSCALE105
The color GrayScale105. -
GRAYSCALE120
The color GrayScale120. -
GRAYSCALE135
The color GrayScale135. -
GRAYSCALE150
The color GrayScale150. -
GRAYSCALE165
The color GrayScale165. -
GRAYSCALE180
The color GrayScale180. -
GRAYSCALE195
The color GrayScale195. -
GRAYSCALE210
The color GrayScale210. -
GRAYSCALE225
The color GrayScale225. -
GRAYSCALE240
The color GrayScale240. -
WHITE
The color White.
-
-
Method Details
-
isDefinedColor
Checks whether the given color is a defined Color.- Parameters:
color- A color.- Returns:
- True if color is one of the colors defined by this class.
-
isDefinedColor
Checks whether the given color is a defined Color in the given mode.- Parameters:
color- A color.mode- the color mode.- Returns:
- True if color is defined.
-
isDefinedColorName
Checks whether the given name is for a defined Color.- Parameters:
cName- a color name- Returns:
- True if 'cName' is a name of one of the colors defined by this class.
-
isDefinedColorName
Checks whether the given name is for a Color defined in the given mode.- Parameters:
cName- a color name.mode- the color mode.- Returns:
- True if 'cName' is defined.
-
getColorCount
public static int getColorCount()Returns the number of colors defined by JaxoColor.- Returns:
- The number of colors defined by JaxoColor.
-
getColor
Returns the color at index i of the colorList.- Parameters:
i- Index of the color to be returned- Returns:
- Color at index i.
-
getColorName
Returns the name of the color at index i in the colorList.- Parameters:
i- Index of the color whose name is to be returned.- Returns:
- Name of the color at index i.
-
getDefaultColor
-
getDefaultFillColor
-
getColor
-
getColor
-
getColorName
-
getColorName
-
getGrayScaleFloat
Returns a string representation of a Color that gives the grayscale of color, or sets it to '0.0' (black), if color is not a grayscale.- Parameters:
color- The color whose grayscale value is to be returned.- Returns:
- The float grayness of the grayscale corresponding to color.
-
isGrayScale
Checks whether the 'color' is closest to one of the gray scales defined in this class.- Parameters:
color- A color.- Returns:
- True if color is a grayscale, false otherwise.
-
getGrayScaleColor
Returns the grayscale that corresponds to the float value f. or null if f is not between 0.f and 1.f- Parameters:
f- A float between 0.f and 1.f- Returns:
- The gray scale corresponding to the float value f.
-
getLatexColorCommand
-
getClosestColorTo
-