|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectColorVector
public class ColorVector
Represents a factor by which to multiply a color's components, including different factors for each component.
Field Summary | |
---|---|
static ColorVector |
ONE
|
static ColorVector |
ZERO
|
Constructor Summary | |
---|---|
ColorVector(double r,
double g,
double b)
Constructs a color vector with the given component multipliers. |
|
ColorVector(float r,
float g,
float b)
Constructs a color vector with the given component multipliers. |
Method Summary | |
---|---|
ColorVector |
add(ColorVector other)
Returns a color vector whose multipliers are the sum of this color's multipliers and the parametere color's multipliers. |
float |
getBlue()
Returns the blue color muliplier. |
float |
getGreen()
Returns the green color muliplier. |
double |
getNorm()
Returns the norm - ie, length - of this color vector. |
float |
getRed()
Returns the red color muliplier. |
Color |
scale(Color other)
Returns a color whose components have been scaled by this color vector's multipliers. |
ColorVector |
scale(ColorVector other)
Returns a color vector whose multipliers are the product of this color's multipliers and the parameter color's multipliers. |
ColorVector |
scale(double scalar)
Returns a color vector whose multipliers are all scaled by the given scalar. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ColorVector ZERO
public static final ColorVector ONE
Constructor Detail |
---|
public ColorVector(double r, double g, double b)
public ColorVector(float r, float g, float b)
Method Detail |
---|
public double getNorm()
public java.lang.String toString()
toString
in class java.lang.Object
public float getRed()
public float getGreen()
public float getBlue()
public ColorVector add(ColorVector other)
public ColorVector scale(double scalar)
public ColorVector scale(ColorVector other)
public Color scale(Color other)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |