Package org.eclipse.mosaic.lib.util
Class ColorUtils
- java.lang.Object
-
- org.eclipse.mosaic.lib.util.ColorUtils
-
public class ColorUtils extends Object
-
-
Method Detail
-
toColor
public static Color toColor(String colorString)
Creates aColor
from a string.- Parameters:
colorString
- color string representation (#XXX, #XXXXXX or the name of the color like red, green etc.)- Returns:
- the color,
null
if no color matches to the given color string
-
toColor
public static Color toColor(String colorString, Color defaultColor)
Creates aColor
from a string.- Parameters:
colorString
- color string representation (#XXX, #XXXXXX or the name of the color like red, green etc.)defaultColor
- the fallback color (if the text to Color transformation didn't work)- Returns:
- the color
-
-