|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.color.ColorUtil
public class ColorUtil
Constructor Summary | |
---|---|
ColorUtil()
|
Method Summary | |
---|---|
static java.awt.Paint |
getCheckerPaint()
Obtain a java.awt.Paint instance which draws a checker
background of black and white. |
static java.awt.Paint |
getCheckerPaint(java.awt.Color c1,
java.awt.Color c2,
int size)
|
static java.awt.Color |
interpolate(java.awt.Color b,
java.awt.Color a,
float t)
|
static java.awt.Color |
removeAlpha(java.awt.Color color)
Returns a new color equal to the old one, except that there is no alpha channel (transparency). |
static java.awt.Color |
setAlpha(java.awt.Color col,
int alpha)
Modifies the passed in color by setting a new alpha channel (transparency) and returns the new color. |
static java.awt.Color |
setBrightness(java.awt.Color color,
float brightness)
Modifies the passed in color by changing it's brightness using HSB calculations. |
static java.awt.Color |
setSaturation(java.awt.Color color,
float saturation)
|
static void |
tileStretchPaint(java.awt.Graphics g,
javax.swing.JComponent comp,
java.awt.image.BufferedImage img,
java.awt.Insets ins)
Draws an image on top of a component by doing a 3x3 grid stretch of the image using the specified insets. |
static java.lang.String |
toHexString(java.awt.Color color)
Produces a String representing the passed in color as a hex value (including the #) suitable for use in html. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorUtil()
Method Detail |
---|
public static java.awt.Color removeAlpha(java.awt.Color color)
color
- the color to remove the alpha (transparency) from
public static java.awt.Color setAlpha(java.awt.Color col, int alpha)
col
- the color to modifyalpha
- the new alpha (transparency) level. Must be an int between 0 and 255
public static java.awt.Color setBrightness(java.awt.Color color, float brightness)
color
- the color to modifybrightness
- the brightness to use in the new color
public static java.lang.String toHexString(java.awt.Color color)
color
- the color to convert
public static java.awt.Paint getCheckerPaint()
java.awt.Paint
instance which draws a checker
background of black and white.
Note: The returned instance may be shared.
Note: This method should be reimplemented to not use a png resource.
public static java.awt.Paint getCheckerPaint(java.awt.Color c1, java.awt.Color c2, int size)
public static void tileStretchPaint(java.awt.Graphics g, javax.swing.JComponent comp, java.awt.image.BufferedImage img, java.awt.Insets ins)
public static java.awt.Color setSaturation(java.awt.Color color, float saturation)
public static java.awt.Color interpolate(java.awt.Color b, java.awt.Color a, float t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |