org.riotfamily.common.util
Class ColorUtils
java.lang.Object
org.riotfamily.common.util.ColorUtils
public final class ColorUtils
- extends Object
- Since:
- 6.5
- Author:
- Felix Gnass [fgnass at neteye dot de]
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColorUtils
public ColorUtils()
parseColor
public static Color parseColor(String s)
throws IllegalArgumentException
- Creates a Color instance from a String. Supported formats are:
#fff
#ffffff
rgb(255,155,155)
rgb(100%,100%,100%)
You may also use one of the color names listed at
http://www.w3schools.com/css/css_colornames.asp
- Throws:
IllegalArgumentException
brightness
public static Color brightness(Color c,
float scale)
- Adjusts the brightness of the given color.
- Parameters:
c
- The color to adjustscale
- The factor (a value from -1 to 1)
saturation
public static Color saturation(Color c,
float scale)
- Adjusts the saturation of the given color.
- Parameters:
c
- The color to adjustscale
- The factor (a value from -1 to 1)
toHex
public static String toHex(Color c)