Package cz.vutbr.fit.layout.model
Class Color
- java.lang.Object
-
- cz.vutbr.fit.layout.model.Color
-
public class Color extends Object
An RGBA color.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
getAlpha()
Returns the alpha value in the range 0-255.int
getBlue()
Returns the blue value in the range 0-255.int
getGreen()
Returns the green value in the range 0-255.int
getRed()
Returns the red value in the range 0-255.int
getRGB()
Returns the RGB value representing the color.int
hashCode()
-
-
-
Constructor Detail
-
Color
public Color(int red, int green, int blue)
Creates a color from the RGB components.- Parameters:
red
-green
-blue
-
-
Color
public Color(int red, int green, int blue, int alpha)
Creates a color from the RGBA components.- Parameters:
red
-green
-blue
-alpha
-
-
Color
public Color(int rgb)
Creates a color from an RGB value- Parameters:
rgb
- the RGB value
-
-
Method Detail
-
getRGB
public int getRGB()
Returns the RGB value representing the color.
-
getRed
public int getRed()
Returns the red value in the range 0-255.- Returns:
- the red value.
-
getGreen
public int getGreen()
Returns the green value in the range 0-255.- Returns:
- the green value.
-
getBlue
public int getBlue()
Returns the blue value in the range 0-255.- Returns:
- the blue component.
-
getAlpha
public int getAlpha()
Returns the alpha value in the range 0-255.- Returns:
- the alpha value.
-
-