- java.lang.Object
-
- org.refcodes.graphical.RgbColorImpl
-
- All Implemented Interfaces:
RgbColor
- Direct Known Subclasses:
RgbPixelImpl
public class RgbColorImpl extends Object implements RgbColor
The Class RgbColorImpl.
-
-
Constructor Summary
Constructors Constructor Description RgbColorImpl()
Instantiates a new rgb pixel impl.RgbColorImpl(int aRgbValue)
Instantiates a new rgb pixel impl.RgbColorImpl(int aAlphaPortion, int aRedPortion, int aGreenPortion, int aBluePortion)
Instantiates a new rgb pixel impl.RgbColorImpl(Color aAwtColor)
Instantiates a new rgb pixel impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getAlpha()
Gets the alpha portion.int
getBlue()
Gets the blue portion.int
getGreen()
Gets the green portion.int
getRed()
Gets the red portion.int
hashCode()
void
setAlphaPortion(int aAlphaPortion)
Sets the alpha portion.void
setBluePortion(int aBluePortion)
Sets the blue portion.void
setGreenPortion(int aGreenPortion)
Sets the green portion.void
setRedPortion(int aRedPortion)
Sets the red portion.void
setRgbValue(int aRgbValue)
Sets the rgb value.int
toRgbValue()
To rgb value.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.graphical.RgbColor
toColor, withAlphaPortion, withBluePortion, withGreenPortion, withRedPortion, withRgbValue
-
-
-
-
Constructor Detail
-
RgbColorImpl
public RgbColorImpl()
Instantiates a new rgb pixel impl.
-
RgbColorImpl
public RgbColorImpl(int aAlphaPortion, int aRedPortion, int aGreenPortion, int aBluePortion)
Instantiates a new rgb pixel impl.- Parameters:
aAlphaPortion
- the alpha portionaRedPortion
- the red portionaGreenPortion
- the green portionaBluePortion
- the blue portion
-
RgbColorImpl
public RgbColorImpl(int aRgbValue)
Instantiates a new rgb pixel impl.- Parameters:
aRgbValue
- the rgb value
-
RgbColorImpl
public RgbColorImpl(Color aAwtColor)
Instantiates a new rgb pixel impl.- Parameters:
aAwtColor
- the rgb value
-
-
Method Detail
-
getAlpha
public int getAlpha()
Gets the alpha portion.
-
getRed
public int getRed()
Gets the red portion.
-
getGreen
public int getGreen()
Gets the green portion.
-
getBlue
public int getBlue()
Gets the blue portion.
-
toRgbValue
public int toRgbValue()
To rgb value.- Specified by:
toRgbValue
in interfaceRgbColor
- Returns:
- the int
-
setRgbValue
public void setRgbValue(int aRgbValue)
Sets the rgb value.- Specified by:
setRgbValue
in interfaceRgbColor
- Parameters:
aRgbValue
- the new rgb value
-
setAlphaPortion
public void setAlphaPortion(int aAlphaPortion)
Sets the alpha portion.- Specified by:
setAlphaPortion
in interfaceRgbColor
- Parameters:
aAlphaPortion
- the new alpha portion
-
setRedPortion
public void setRedPortion(int aRedPortion)
Sets the red portion.- Specified by:
setRedPortion
in interfaceRgbColor
- Parameters:
aRedPortion
- the new red portion
-
setGreenPortion
public void setGreenPortion(int aGreenPortion)
Sets the green portion.- Specified by:
setGreenPortion
in interfaceRgbColor
- Parameters:
aGreenPortion
- the new green portion
-
setBluePortion
public void setBluePortion(int aBluePortion)
Sets the blue portion.- Specified by:
setBluePortion
in interfaceRgbColor
- Parameters:
aBluePortion
- the new blue portion
-
-