Class AWTColor


  • public class AWTColor
    extends Object
    Allows for color manipulation similar to the default Java Color class
    • Field Detail

      • white

        public static final AWTColor white
        The color white.
      • WHITE

        public static final AWTColor WHITE
        The color white.
      • lightGray

        public static final AWTColor lightGray
        The color light gray.
      • LIGHT_GRAY

        public static final AWTColor LIGHT_GRAY
        The color light gray.
      • gray

        public static final AWTColor gray
        The color gray.
      • GRAY

        public static final AWTColor GRAY
        The color gray.
      • darkGray

        public static final AWTColor darkGray
        The color dark gray.
      • DARK_GRAY

        public static final AWTColor DARK_GRAY
        The color dark gray.
      • black

        public static final AWTColor black
        The color black.
      • BLACK

        public static final AWTColor BLACK
        The color black.
      • red

        public static final AWTColor red
        The color red.
      • RED

        public static final AWTColor RED
        The color red.
      • pink

        public static final AWTColor pink
        The color pink.
      • PINK

        public static final AWTColor PINK
        The color pink.
      • orange

        public static final AWTColor orange
        The color orange.
      • ORANGE

        public static final AWTColor ORANGE
        The color orange.
      • yellow

        public static final AWTColor yellow
        The color yellow.
      • YELLOW

        public static final AWTColor YELLOW
        The color yellow.
      • green

        public static final AWTColor green
        The color green.
      • GREEN

        public static final AWTColor GREEN
        The color green.
      • magenta

        public static final AWTColor magenta
        The color magenta.
      • MAGENTA

        public static final AWTColor MAGENTA
        The color magenta.
      • cyan

        public static final AWTColor cyan
        The color cyan.
      • CYAN

        public static final AWTColor CYAN
        The color cyan.
      • blue

        public static final AWTColor blue
        The color blue.
      • BLUE

        public static final AWTColor BLUE
        The color blue.
      • color

        public int color
    • Constructor Detail

      • AWTColor

        public AWTColor​(int c)
        Creates an AWTColor from a color int
        Parameters:
        c - The color integer
      • AWTColor

        public AWTColor​(int r,
                        int g,
                        int b)
        Creates an AWTColor with the specified RGB values that is fully opaque
        Parameters:
        r - The red component
        g - The green component
        b - The blue component
      • AWTColor

        public AWTColor​(int r,
                        int g,
                        int b,
                        int a)
        Creates an AWTColor with the specified RGBA values
        Parameters:
        r - The red component
        g - The green component
        b - The blue component
        a - The alpha component
      • AWTColor

        public AWTColor​(float r,
                        float g,
                        float b)
        Creates an AWTColor with the specified RGB values
        Parameters:
        r - The red component as a float in the range (0.0f - 1.0f)
        g - The green component as a float in the range (0.0f - 1.0f)
        b - The blue component as a float in the range (0.0f - 1.0f)
    • Method Detail

      • getRed

        public int getRed()
        Returns the red component of this color
        Returns:
        the value of the red component
      • getGreen

        public int getGreen()
        Returns the green component of this color
        Returns:
        the value of the green component
      • getBlue

        public int getBlue()
        Returns the blue component of this color
        Returns:
        the value of the blue component
      • getAlpha

        public int getAlpha()
        Returns the alpha component of this color
        Returns:
        the value of the alpha component
      • getRGBColorComponents

        public float[] getRGBColorComponents​(float[] compArray)
        Returns the RGB values range (0.0 - 1.0) as a float array
        Parameters:
        compArray - the array that will hold the values or null
        Returns:
        the float array of the RGB values