Class Color

    • Constructor Detail

      • Color

        public Color()
        Creates a new Color with default values.
      • Color

        public Color​(long value)
        Creates a new Color with the given value.
        Parameters:
        value -
        Throws:
        ArgumentIsOutOfRangeException - if the given value is not a true color value with an optional alpha value.
      • Color

        public Color​(int redValue,
                     int greenValue,
                     int blueValue)
        Creates a new Color with the given red value, green value and blue value.
        Parameters:
        redValue -
        greenValue -
        blueValue -
      • Color

        public Color​(int redValue,
                     int greenValue,
                     int blueValue,
                     int alphaValue)
        Creates a new Color with the given red value, green value, blue value and alpha value.
        Parameters:
        redValue -
        greenValue -
        blueValue -
        alphaValue -
      • Color

        public Color​(java.lang.String value)
        Creates a new Color with the given value.
        Parameters:
        value -
        Throws:
        InvalidArgumentException - if the given value is not a color name or true color value with an optional alpha value.
    • Method Detail

      • fromSpecification

        public static Color fromSpecification​(BaseNode specification)
        Parameters:
        specification -
        Returns:
        a new Color from the given specification
        Throws:
        InvalidArgumentException - if the given specification is not valid.
      • getWebColors

        public static IContainer<Color> getWebColors()
        Returns:
        the web colors.
      • getWebColorPairs

        public static IContainer<Pair<java.lang.String,​Color>> getWebColorPairs()
        Returns:
        the web color pairs.
      • createSwingColor

        public java.awt.Color createSwingColor()
        Returns:
        a new Color from the current Color.
      • getAlphaValue

        public int getAlphaValue()
        Returns:
        the alpha value of the current Color.
      • getBlueValue

        public int getBlueValue()
        Returns:
        the blue value of the current Color.
      • getGreenValue

        public int getGreenValue()
        Returns:
        the green value of the current Color.
      • getHexadecimalValue

        public java.lang.String getHexadecimalValue()
        Returns:
        the hexadecimal value of the current Color.
      • getHexadecimalValueAlwaysWithAlphaValue

        public java.lang.String getHexadecimalValueAlwaysWithAlphaValue()
        Returns:
        the hexadecimal value of the current Color always with alpha value.
      • getHexadecimalValueOrColorName

        public java.lang.String getHexadecimalValueOrColorName()
        Returns:
        the hexadecimal value of the current Color or its color name.
      • getInvertedColor

        public Color getInvertedColor()
        When a Color is inverted, the alpha value does not change.
        Returns:
        a new Color that is the inverted color of the current Color.
      • getInvertedNormalizedAlphaValue

        public double getInvertedNormalizedAlphaValue()
        Returns:
        the inverted normalized alpha value of the current Color.
      • getInvertedNormalizedBlueValue

        public double getInvertedNormalizedBlueValue()
        Returns:
        the inverted normalized blue value of the current Color.
      • getInvertedNormalizedGreenValue

        public double getInvertedNormalizedGreenValue()
        Returns:
        the inverted normalized green value of the current Color.
      • getInvertedNormalizedRedValue

        public double getInvertedNormalizedRedValue()
        Returns:
        the inverted normalized red value of the current Color.
      • getNormalizedAlphaValue

        public double getNormalizedAlphaValue()
        Returns:
        the normalized alpha value of the current Color.
      • getNormalizedBlueValue

        public double getNormalizedBlueValue()
        Returns:
        the normalized blue value of the current Color.
      • getNormalizedGreenValue

        public double getNormalizedGreenValue()
        Returns:
        the normalized green value of the current Color.
      • getNormalizedRedValue

        public double getNormalizedRedValue()
        Returns:
        the normalized red value of the current Color.
      • getRedValue

        public int getRedValue()
        Returns:
        the red value of the current Color.
      • hasAlphaValue

        public boolean hasAlphaValue()
        Returns:
        true if the current Color has an alpha value.
      • hasBlueValue

        public boolean hasBlueValue()
        Returns:
        true if the current Color has a blue value.
      • hasFullAlphaValue

        public boolean hasFullAlphaValue()
        Returns:
        true if the current Color has a full alpha value.
      • hasFullBlueValue

        public boolean hasFullBlueValue()
        Returns:
        true if the current Color has a full blue value.
      • hasFullGreenValue

        public boolean hasFullGreenValue()
        Returns:
        true if the current Color has a full green value.
      • hasFullRedValue

        public boolean hasFullRedValue()
        Returns:
        true if the current Color has a full red value.
      • hasGreenValue

        public boolean hasGreenValue()
        Returns:
        true if the current Color has a green value.
      • hasRedValue

        public boolean hasRedValue()
        Returns:
        true if the current Color has a red value.
      • toColorWithFullAlphaValue

        public Color toColorWithFullAlphaValue()
        Returns:
        a new Color that is like the current Color with a full alpha value.
      • toLong

        public long toLong()
        Returns:
        the integer value of the current Color.