Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.pqt.autorib.util
Class Color  view Color download Color.java

java.lang.Object
  extended byorg.pqt.autorib.util.Point
      extended byorg.pqt.autorib.util.Color
All Implemented Interfaces:
java.lang.Cloneable

public class Color
extends Point

a class to handle colors


Field Summary
 
Fields inherited from class org.pqt.autorib.util.Point
value
 
Constructor Summary
Color()
          initialize the color to {0,0,0}
Color(float r, float g, float b)
          initialize the color to the given values
Color(java.util.Vector v)
          initialize a color from a Vector
Color(java.util.Vector v, int index)
          initialize a color from a Vector, starting at the given index
 
Method Summary
static boolean fuzzyEquals(Color a, Color b, double gap)
          return true if the difference between each component in a and its equivalent in b is less than the value gap
 void initColor(java.util.Vector v, int index)
          initialize a color from a Vector, starting at the given index
 
Methods inherited from class org.pqt.autorib.util.Point
add, add, clone, Clone, convertVector, cross, cross, dot, dot, equals, equals, fuzzyEquals, initPoint, length, length, lengthSquared, lengthSquared, mult, mult, normalize, normalize, percentageDifference, subtract, subtract, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Color

public Color()
initialize the color to {0,0,0}


Color

public Color(float r,
             float g,
             float b)
initialize the color to the given values


Color

public Color(java.util.Vector v)
      throws java.lang.Exception
initialize a color from a Vector


Color

public Color(java.util.Vector v,
             int index)
      throws java.lang.Exception
initialize a color from a Vector, starting at the given index

Method Detail

initColor

public void initColor(java.util.Vector v,
                      int index)
               throws java.lang.Exception
initialize a color from a Vector, starting at the given index


fuzzyEquals

public static boolean fuzzyEquals(Color a,
                                  Color b,
                                  double gap)
return true if the difference between each component in a and its equivalent in b is less than the value gap