Class RgbColorImpl

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 Details

    • 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 portion
      aRedPortion - the red portion
      aGreenPortion - the green portion
      aBluePortion - 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 Details

    • getAlpha

      public int getAlpha()
      Gets the alpha portion.
      Specified by:
      getAlpha in interface RgbColor
      Returns:
      the alpha portion
    • getRed

      public int getRed()
      Gets the red portion.
      Specified by:
      getRed in interface RgbColor
      Returns:
      the red portion
    • getGreen

      public int getGreen()
      Gets the green portion.
      Specified by:
      getGreen in interface RgbColor
      Returns:
      the green portion
    • getBlue

      public int getBlue()
      Gets the blue portion.
      Specified by:
      getBlue in interface RgbColor
      Returns:
      the blue portion
    • toRgbValue

      public int toRgbValue()
      To rgb value.
      Specified by:
      toRgbValue in interface RgbColor
      Returns:
      the int
    • setRgbValue

      public void setRgbValue(int aRgbValue)
      Sets the rgb value.
      Specified by:
      setRgbValue in interface RgbColor
      Parameters:
      aRgbValue - the new rgb value
    • setAlphaPortion

      public void setAlphaPortion(int aAlphaPortion)
      Sets the alpha portion.
      Specified by:
      setAlphaPortion in interface RgbColor
      Parameters:
      aAlphaPortion - the new alpha portion
    • setRedPortion

      public void setRedPortion(int aRedPortion)
      Sets the red portion.
      Specified by:
      setRedPortion in interface RgbColor
      Parameters:
      aRedPortion - the new red portion
    • setGreenPortion

      public void setGreenPortion(int aGreenPortion)
      Sets the green portion.
      Specified by:
      setGreenPortion in interface RgbColor
      Parameters:
      aGreenPortion - the new green portion
    • setBluePortion

      public void setBluePortion(int aBluePortion)
      Sets the blue portion.
      Specified by:
      setBluePortion in interface RgbColor
      Parameters:
      aBluePortion - the new blue portion
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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