Package com.facilita.fc.eggPlant
Class Color
- java.lang.Object
-
- com.facilita.fc.eggPlant.Color
-
public class Color extends java.lang.ObjectRepresents a color as an RGB value.
-
-
Constructor Summary
Constructors Constructor Description Color(int r, int g, int b)Creates aColorobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intB()Returns the blue component of thisColor.static ColorfromString(java.lang.String text)Creates aColorobject from a string in the form "r,g,b"intG()Returns the green component of thisColor.intR()Returns the red component of thisColor.java.lang.StringtoString()
-
-
-
Method Detail
-
fromString
public static Color fromString(java.lang.String text)
Creates aColorobject from a string in the form "r,g,b"- Parameters:
text- the text to parse- Returns:
- a
Colorobject
-
R
public int R()
Returns the red component of thisColor.- Returns:
- the red component
-
G
public int G()
Returns the green component of thisColor.- Returns:
- the green component
-
B
public int B()
Returns the blue component of thisColor.- Returns:
- the blue component
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-