Package org.jfree.util
Class PaintUtilities
- java.lang.Object
-
- org.jfree.util.PaintUtilities
-
public class PaintUtilities extends Object
Utility code that relates toPaint
objects.- Author:
- David Gilbert
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
colorToString(Color c)
Converts a color into a string.static boolean
equal(Paint p1, Paint p2)
Returnstrue
if the twoPaint
objects are equal OR bothnull
.static Color
stringToColor(String value)
Converts a given string into a color.
-
-
-
Method Detail
-
equal
public static boolean equal(Paint p1, Paint p2)
Returnstrue
if the twoPaint
objects are equal OR bothnull
. This method handlesGradientPaint
as a special case.- Parameters:
p1
- paint 1 (null
permitted).p2
- paint 2 (null
permitted).- Returns:
- A boolean.
-
colorToString
public static String colorToString(Color c)
Converts a color into a string. If the color is equal to one of the defined constant colors, that name is returned instead. Otherwise the color is returned as hex-string.- Parameters:
c
- the color.- Returns:
- the string for this color.
-
-