Class symantec.itools.awt.util.ColorUtils
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class symantec.itools.awt.util.ColorUtils
Object
   |
   +----symantec.itools.awt.util.ColorUtils
  -  public class ColorUtils
  
-  extends Object
  
Many useful color related utility functions for color manipulation.
 
  -  Version:
  
 -  1.1, August 5, 1997
  
 -  Author:
  
 -  Symantec
 
  
  -  
	symantec.itools.awt.util.ColorUtils()
   -   Do not use, this is an all-static class.
 
  
  -  
	calculateHilightColor(Color)
   -   Used to calculate a hilight color from a given color.
  
 -  
	calculateShadowColor(Color)
   -   Used to calculate a shadow color from a given color.
  
 -  
	darken(int, int, int, double)
   -   Darkens a given color by the specified percentage.
  
 -  
	darken(Color, double)
   -   Darkens a given color by the specified percentage.
  
 -  
	fade(Color, Color, double)
   -   Fades from one color to another by the given percentage.
  
 -  
	lighten(int, int, int, double)
   -   Lightens a given color by the specified percentage.
  
 -  
	lighten(Color, double)
   -   Lightens a given color by the specified percentage.
  
 -  
	lightness(Color)
   -   Given a Color this function determines the lightness percent.
 
  
ColorUtils
public ColorUtils()
  -  Do not use, this is an all-static class.
  
 
 
  
calculateHilightColor
public static java.awt.Color calculateHilightColor(Color c)
  -  Used to calculate a hilight color from a given color.
  
 
 
    -  Parameters:
    
 -  c - The color to use in the calculation.  If null, then
 it will return null.
    
 -  Returns:
    
 -  the newly calculated hilight color.
  
 
 
 
calculateShadowColor
public static java.awt.Color calculateShadowColor(Color c)
  -  Used to calculate a shadow color from a given color.
  
 
 
    -  Parameters:
    
 -  c - The color to use in the calculation  If null, then
 it will return null.
    
 -  Returns:
    
 -  the newly calculated shadow color.
  
 
 
 
darken
public static java.awt.Color darken(int r,
                                    int g,
                                    int b,
                                    double percent) throws IllegalArgumentException
  -  Darkens a given color by the specified percentage.
  
 
 
    -  Parameters:
    
 -  r - The red component of the color to darken.
    
-  g - The green component of the color to darken.
    
-  b - The blue component of the color to darken.
    
-  percent - percentage to darken.  Needs to be <= 1 && >= 0.
    
    -  Returns:
    
 -  a new Color with the desired characteristics.
    
 -  Throws: IllegalArgumentException
    
 -   if the specified percentage value is unacceptable
  
 
 
 
darken
public static java.awt.Color darken(Color c,
                                    double percent) throws IllegalArgumentException
  -  Darkens a given color by the specified percentage.
  
 
 
    -  Parameters:
    
 -  to - the Color to darken.
    
-  percent - percentage to darken.  Needs to be <= 1 && >= 0.
    
  -  Returns:
    
 -  a new Color with the desired characteristics.
    
 -  Throws: IllegalArgumentException
    
 -   if the specified percentage value is unacceptable
  
 
 
 
fade
public static java.awt.Color fade(Color from,
                                  Color to,
                                  double percent) throws IllegalArgumentException
  -  Fades from one color to another by the given percentage.
  
 
 
    -  Parameters:
    
 -  from - the Color to fade from.
    
-  to - the Color to fade to.
    
-  percent - percentage to fade.  Needs to be <= 1 && >= 0.
    
   -  Returns:
    
 -  a new Color with the desired characteristics.
    
 -  Throws: IllegalArgumentException
    
 -   if the specified percentage value is unacceptable
  
 
 
 
lighten
public static java.awt.Color lighten(int r,
                                     int g,
                                     int b,
                                     double percent) throws IllegalArgumentException
  -  Lightens a given color by the specified percentage.
  
 
 
    -  Parameters:
    
 -  r - The red component of the color to lighten.
    
-  g - The green component of the color to lighten.
    
-  b - The blue component of the color to lighten.
    
-  percent - percentage to lighten.  Needs to be <= 1 && >= 0.
    
    -  Returns:
    
 -  a new Color with the desired characteristics.
    
 -  Throws: IllegalArgumentException
    
 -   if the specified percentage value is unacceptable
  
 
 
 
lighten
public static java.awt.Color lighten(Color c,
                                     double percent) throws IllegalArgumentException
  -  Lightens a given color by the specified percentage.
  
 
 
    -  Parameters:
    
 -  to - the Color to lighten.
    
-  percent - percentage to lighten.  Needs to be <= 1 && >= 0.
    
  -  Returns:
    
 -  a new Color with the desired characteristics.
    
 -  Throws: IllegalArgumentException
    
 -   if the specified percentage value is unacceptable
  
 
 
 
lightness
public static double lightness(Color c)
  -  Given a Color this function determines the lightness percent.
  
 
 
    -  Parameters:
    
 -  c - The Color to calculate from.  If null, it will return 0.
    
 -  Returns:
    
 -  the percent light of the specified color.  This value will be
 >= 0 && <= 1.
  
 
 
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index