Class RgbaQuadruplet

java.lang.Object
de.xima.fc.color.RgbaQuadruplet
All Implemented Interfaces:
IOpaqueRgbHexColorProviding, Serializable

public class RgbaQuadruplet extends Object implements IOpaqueRgbHexColorProviding, Serializable
Represents an RGBA (red, green, blue, alpha) quadruplet.
Since:
8.2.0
Author:
XIMA MEDIA GmbH
See Also:
  • Method Details

    • equals

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

      public int getAlphaInt()
    • getAlphaNorm

      public double getAlphaNorm()
    • getBlueInt

      public int getBlueInt()
    • getBlueNorm

      public double getBlueNorm()
    • getGreenInt

      public int getGreenInt()
    • getGreenNorm

      public double getGreenNorm()
    • getHex

      public String getHex()
    • getOpaqueRgbHexColor

      public int getOpaqueRgbHexColor()
      Description copied from interface: IOpaqueRgbHexColorProviding
      Gets the opaque color as a hex RGB value, e.g. 0x#FF0000 for red.
      Specified by:
      getOpaqueRgbHexColor in interface IOpaqueRgbHexColorProviding
      Returns:
      The hex RGB value of the color.
    • getRedInt

      public int getRedInt()
    • getRedNorm

      public double getRedNorm()
    • getRgba

      public long getRgba()
    • hashCode

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

      public RgbaQuadruplet scaled(double scaleRed, double scaleGreen, double scaleBlue, double alphaScale)
      Parameters:
      scaleRed - Scale for the red value.
      scaleGreen - Scale for the green value.
      scaleBlue - Scale for the blue value.
      alphaScale - Scale for the alpha value.
      Returns:
      Scales all components by the given factors.
    • toCssColor

      public CssColor toCssColor()
      Converts this rgba quadruplet to a CSS color.
      Returns:
      The CSS color.
    • toRgbTriple

      public RgbTriplet toRgbTriple()
      Converts this rgba quadruplet to a RGB triplet. Sets the alpha value to 1 (fully opaque).
      Returns:
      The RGB triplet.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • withAlpha

      public RgbaQuadruplet withAlpha(int newAlpha)
    • withAlpha

      public RgbaQuadruplet withAlpha(double newAlpha)
    • of

      public static RgbaQuadruplet of(double red, double green, double blue, double alpha)
    • of

      public static RgbaQuadruplet of(double[] components)
    • of

      public static RgbaQuadruplet of(long rgba)
    • of

      public static RgbaQuadruplet of(int red, int green, int blue, int alpha)
    • of

      public static RgbaQuadruplet of(String hexString)
    • of

      public static RgbaQuadruplet of(String hexString, RgbaQuadruplet defaultValue)