org.fest.assertions.data
Class RgbColor

java.lang.Object
  extended by org.fest.assertions.data.RgbColor

public final class RgbColor
extends Object

A color.

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 int b
          The blue component of this color.
 int g
          The green component of this color.
 int r
          The red component of this color.
 
Method Summary
static RgbColor color(int rgb)
          Creates a new RgbColor.
 boolean equals(Object obj)
           
 int hashCode()
           
 boolean isEqualTo(RgbColor color, Offset<Integer> offset)
          Indicates whether the given RgbColor is equal to this one.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

r

public final int r
The red component of this color.


g

public final int g
The green component of this color.


b

public final int b
The blue component of this color.

Method Detail

color

public static RgbColor color(int rgb)
Creates a new RgbColor.

Parameters:
rgb - a value representing a RGB combination.
Returns:
the created color.

isEqualTo

public boolean isEqualTo(RgbColor color,
                         Offset<Integer> offset)
Indicates whether the given RgbColor is equal to this one.

Parameters:
color - the RgbColor to compare this one to.
offset - used to tolerate a difference between the individual components of the RgbColors to compare.
Returns:
true if the given RgbColor is equal to this one; false otherwise.
Throws:
NullPointerException - if the given offset is null.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.