Class BaseColor

  • Direct Known Subclasses:
    ExtendedColor

    public class BaseColor
    extends java.lang.Object
    • Constructor Detail

      • BaseColor

        public BaseColor​(int red,
                         int green,
                         int blue,
                         int alpha)
        Construct a new BaseColor.
        Parameters:
        red - the value for the red gamma
        green - the value for the green gamma
        blue - the value for the blue gamma
        alpha - the value for the alpha gamma
      • BaseColor

        public BaseColor​(int red,
                         int green,
                         int blue)
        Parameters:
        red -
        green -
        blue -
      • BaseColor

        public BaseColor​(float red,
                         float green,
                         float blue,
                         float alpha)
        Construct a BaseColor with float values.
        Parameters:
        red -
        green -
        blue -
        alpha -
      • BaseColor

        public BaseColor​(float red,
                         float green,
                         float blue)
        Construct a BaseColor with float values.
        Parameters:
        red -
        green -
        blue -
      • BaseColor

        public BaseColor​(int argb)
        Construct a BaseColor by setting the combined value.
        Parameters:
        argb -
    • Method Detail

      • getRGB

        public int getRGB()
        Returns:
        the combined color value
      • getRed

        public int getRed()
        Returns:
        the value for red
      • getGreen

        public int getGreen()
        Returns:
        the value for green
      • getBlue

        public int getBlue()
        Returns:
        the value for blue
      • getAlpha

        public int getAlpha()
        Returns:
        the value for the alpha channel
      • brighter

        public BaseColor brighter()
        Make this BaseColor brighter. Factor used is 0.7.
        Returns:
        the new BaseColor
      • darker

        public BaseColor darker()
        Make this color darker. Factor used is 0.7
        Returns:
        the new BaseColor
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setValue

        protected void setValue​(int red,
                                int green,
                                int blue,
                                int alpha)
      • validate

        private static void validate​(int value)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object