Compiere 3.1

org.compiere.apps.graph
Class GraphUtil

java.lang.Object
  extended by org.compiere.apps.graph.GraphUtil

public class GraphUtil
extends Object

Graphic Utilities

Version:
$Id: GraphUtil.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
Author:
Jorg Janke

Constructor Summary
GraphUtil()
           
 
Method Summary
static Color brighter(Color color, double factor)
          Get brighter color
static double colorDistance(double r1, double g1, double b1, double r2, double g2, double b2)
          Simple Color Distance
static Color darker(Color color, double factor)
          Get darker color
static Color getBackground(int index)
          Get Column Background
static Color getForeground(Color background)
          Get Foreground for back
static boolean isDark(Color color)
          Is the Color dark?
static boolean isDark(double r, double g, double b)
          Is Color more white or black?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphUtil

public GraphUtil()
Method Detail

getForeground

public static Color getForeground(Color background)
Get Foreground for back

Parameters:
background - back
Returns:
while or black

getBackground

public static Color getBackground(int index)
Get Column Background

Parameters:
index - index
Returns:
random color

isDark

public static boolean isDark(Color color)
Is the Color dark?

Parameters:
color - color
Returns:
true if dark

isDark

public static boolean isDark(double r,
                             double g,
                             double b)
Is Color more white or black?

Parameters:
r - red
g - green
b - blue
Returns:
true if dark

colorDistance

public static double colorDistance(double r1,
                                   double g1,
                                   double b1,
                                   double r2,
                                   double g2,
                                   double b2)
Simple Color Distance. (3d point distance)

Parameters:
r1 - first red
g1 - first green
b1 - first blue
r2 - second red
g2 - second green
b2 - second blue
Returns:
3d distance for relative comparison

darker

public static Color darker(Color color,
                           double factor)
Get darker color

Parameters:
color - color
factor - factor 0..1 (AWT 0.7) the smaller, the darker
Returns:
darker color

brighter

public static Color brighter(Color color,
                             double factor)
Get brighter color

Parameters:
color - color
factor - factor 0..1 (AWT 0.7) the smaller, the lighter
Returns:
brighter color

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.