com.dlsc.flexgantt.swing.util
Class ColorUtil

java.lang.Object
  extended by com.dlsc.flexgantt.swing.util.ColorUtil

public class ColorUtil
extends java.lang.Object

A utility class for dealing with instances of Color.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
static int getDefaultAlpha()
          Returns the default alpha value used for making colors transparent.
static java.awt.Color makeTransparent(java.awt.Color color)
          Converts the given color into a transparent color with the same red, green, blue values.
static java.awt.Color makeTransparent(java.awt.Color color, int alpha)
          Converts the given color into a transparent color with the same red, green, blue values.
static void setDefaultAlpha(int alpha)
          Sets the default alpha value used for making colors transparent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeTransparent

public static java.awt.Color makeTransparent(java.awt.Color color)
Converts the given color into a transparent color with the same red, green, blue values. This method delegates to the method makeTransparent(Color, int) and uses the default alpha value.

Parameters:
color - the now transparent copy of the passed in color
Returns:
the now transparent color
Since:
1.0
See Also:
setDefaultAlpha(int)

makeTransparent

public static java.awt.Color makeTransparent(java.awt.Color color,
                                             int alpha)
Converts the given color into a transparent color with the same red, green, blue values.

Parameters:
color - the now transparent copy of the passed in color
alpha - the alpha value that will be used for the new color
Returns:
the now transparent copy of the passed in color
Since:
1.0

getDefaultAlpha

public static int getDefaultAlpha()
Returns the default alpha value used for making colors transparent.

Returns:
the default alpha value ([0, 255])
Since:
1.0
See Also:
makeTransparent(Color)

setDefaultAlpha

public static void setDefaultAlpha(int alpha)
Sets the default alpha value used for making colors transparent.

Parameters:
alpha - the default alpha value ([0, 255])
Since:
1.0
See Also:
makeTransparent(Color)