Package com.facilita.fc.eggPlant
Class Color
- java.lang.Object
-
- com.facilita.fc.eggPlant.Color
-
public class Color extends java.lang.Object
Represents a color as an RGB value.
-
-
Constructor Summary
Constructors Constructor Description Color(int r, int g, int b)
Creates aColor
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
B()
Returns the blue component of thisColor
.static Color
fromString(java.lang.String text)
Creates aColor
object from a string in the form "r,g,b"int
G()
Returns the green component of thisColor
.int
R()
Returns the red component of thisColor
.java.lang.String
toString()
-
-
-
Method Detail
-
fromString
public static Color fromString(java.lang.String text)
Creates aColor
object from a string in the form "r,g,b"- Parameters:
text
- the text to parse- Returns:
- a
Color
object
-
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:
toString
in classjava.lang.Object
-
-