java.lang.Object
java.awt.Color
- All Implemented Interfaces:
- Paint, Transparency, Serializable
- Direct Known Subclasses:
- ColorUIResource, SystemColor
- See Also:
- Top Examples, Source Code,
ColorSpace
,
AlphaComposite
public static final Color BLACK
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color BLUE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color brighter()
- See Also:
darker()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(float r,
float g,
float b)
- See Also:
getRGB()
, getBlue()
, getGreen()
, getRed()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(float r,
float g,
float b,
float a)
- See Also:
getRGB()
, getAlpha()
, getBlue()
, getGreen()
, getRed()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(int rgb)
- See Also:
getRGB()
, getBlue()
, getGreen()
, getRed()
, ColorModel.getRGBdefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(int rgba,
boolean hasalpha)
- See Also:
getRGB()
, getAlpha()
, getBlue()
, getGreen()
, getRed()
, ColorModel.getRGBdefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(int r,
int g,
int b)
- See Also:
getRGB()
, getBlue()
, getGreen()
, getRed()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(int r,
int g,
int b,
int a)
- See Also:
getRGB()
, getAlpha()
, getBlue()
, getGreen()
, getRed()
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color(ColorSpace cspace,
float[] components,
float alpha)
- See Also:
getColorComponents(float[])
, getComponents(float[])
, IllegalArgumentException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public PaintContext createContext(ColorModel cm,
Rectangle r,
Rectangle2D r2d,
AffineTransform xform,
RenderingHints hints)
- See Also:
Graphics2D.setPaint(java.awt.Paint)
, Paint
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color CYAN
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Color darker()
- See Also:
brighter()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1691]is correct?
By riccardo_desanctis { at } yahoo { dot } it on 2006/01/04 12:20:05 Rate
Color mio=new Color ( 255,0,0 ) ;
g.setColor ( mio.darker ( ) ) ;
g.drawString ( "Riccardo",150,150 ) ;
public static final Color darkGray
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color DARK_GRAY
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Color decode(String nm)
throws NumberFormatException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1815]Usage
By Anonymous on 2006/08/28 15:38:54 Rate
Make sure to prefix your hex string with 0x, for example:
Color.decode ( "0x3C438A" )
public boolean equals(Object obj)
- See Also:
Hashtable
, Object.hashCode()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getAlpha()
- See Also:
getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getBlue()
- See Also:
getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Color getColor(String nm)
- See Also:
Color(int)
, Integer.getInteger(java.lang.String)
, System.getProperty(java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Color getColor(String nm,
int v)
- See Also:
Color(int)
, Integer.getInteger(java.lang.String)
, System.getProperty(java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Color getColor(String nm,
Color v)
- See Also:
Color(int)
, Integer.getInteger(java.lang.String)
, System.getProperty(java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getColorComponents(float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getColorComponents(ColorSpace cspace,
float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public ColorSpace getColorSpace()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getComponents(float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getComponents(ColorSpace cspace,
float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getGreen()
- See Also:
getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Color getHSBColor(float h,
float s,
float b)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRed()
- See Also:
getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getRGB()
- See Also:
getBlue()
, getGreen()
, getRed()
, ColorModel.getRGBdefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getRGBColorComponents(float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public float[] getRGBComponents(float[] compArray)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getTransparency()
- See Also:
createContext(java.awt.image.ColorModel, java.awt.Rectangle, java.awt.geom.Rectangle2D, java.awt.geom.AffineTransform, java.awt.RenderingHints)
, Transparency
, Paint
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color GRAY
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color GREEN
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int hashCode()
- See Also:
Hashtable
, Object.equals(java.lang.Object)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static int HSBtoRGB(float hue,
float saturation,
float brightness)
- See Also:
ColorModel.getRGBdefault()
, Color(int)
, getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color lightGray
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color LIGHT_GRAY
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color MAGENTA
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color ORANGE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color PINK
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color RED
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static float[] RGBtoHSB(int r,
int g,
int b,
float[] hsbvals)
- See Also:
ColorModel.getRGBdefault()
, Color(int)
, getRGB()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[763]Convert color RGB to HSB
By Anonymous on 2004/05/28 04:05:04 Rate
// Convert RGB to HSB
float [ ] hsb = Color.RGBtoHSB ( red, green, blue, null ) ;
float hue = hsb [ 0 ] ; // .58333
float saturation = hsb [ 1 ] ; // .66667
float brightness = hsb [ 2 ] ; // .6
public String toString()
- See Also:
- Object
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color WHITE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final Color YELLOW
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples