org.jhotdraw.color
Class ColorUtil
- java.lang.Object
-
- org.jhotdraw.color.ColorUtil
-
public class ColorUtil extends java.lang.ObjectA utility class forColorandColorSpaceobjects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static float[]fromColor(java.awt.color.ColorSpace colorSpace, java.awt.Color c)Returns the color components in the specified color space from aColorobject.static float[]fromRGB(java.awt.color.ColorSpace colorSpace, int rgb)Returns the color components in the specified color space from an rgb value.static float[]fromRGB(java.awt.color.ColorSpace colorSpace, int r, int g, int b)Returns the color components in the specified color space from RGB values.static java.lang.StringgetName(java.awt.color.ColorSpace a)Returns the name of the color space.static booleanisEqual(java.awt.color.ColorSpace a, java.awt.color.ColorSpace b)Returns true, if the two color spaces are equal.static java.awt.Colorshadow(java.awt.Color c, int amount)Blackens the specified color by casting a black shadow of the specified amount on the color.static java.awt.ColortoColor(java.awt.color.ColorSpace colorSpace, float... components)Returns a color object from color components in the specified color space.static inttoRGB(java.awt.color.ColorSpace colorSpace, float... components)Returns an rgb value from color components in the specified color space.static java.lang.StringtoToolTipText(java.awt.Color c)Returns a tool tip text for the specified color with information in the color space of the color.
-
-
-
Method Detail
-
fromColor
public static float[] fromColor(java.awt.color.ColorSpace colorSpace, java.awt.Color c)Returns the color components in the specified color space from aColorobject.
-
toColor
public static java.awt.Color toColor(java.awt.color.ColorSpace colorSpace, float... components)Returns a color object from color components in the specified color space.
-
fromRGB
public static float[] fromRGB(java.awt.color.ColorSpace colorSpace, int rgb)Returns the color components in the specified color space from an rgb value.
-
fromRGB
public static float[] fromRGB(java.awt.color.ColorSpace colorSpace, int r, int g, int b)Returns the color components in the specified color space from RGB values.
-
toRGB
public static int toRGB(java.awt.color.ColorSpace colorSpace, float... components)Returns an rgb value from color components in the specified color space.
-
toToolTipText
public static java.lang.String toToolTipText(java.awt.Color c)
Returns a tool tip text for the specified color with information in the color space of the color.
-
isEqual
public static boolean isEqual(java.awt.color.ColorSpace a, java.awt.color.ColorSpace b)Returns true, if the two color spaces are equal.
-
getName
public static java.lang.String getName(java.awt.color.ColorSpace a)
Returns the name of the color space. If the color space is anICC_ColorSpacethe name is retrieved from the "desc" data element of the color profile.- Parameters:
a- A ColorSpace.- Returns:
- The name.
-
shadow
public static java.awt.Color shadow(java.awt.Color c, int amount)Blackens the specified color by casting a black shadow of the specified amount on the color.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG