Class ColorWithFallback

java.lang.Object
java.awt.Color
org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
org.apache.fop.util.ColorWithFallback
All Implemented Interfaces:
Paint, Transparency, Serializable

public class ColorWithFallback extends org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
This class is a Color subclass adding a fallback color that FOP uses to re-serialize color specifications as textual functions. The fallback is otherwise not used in producing output formats.
See Also:
  • Constructor Details

    • ColorWithFallback

      public ColorWithFallback(ColorSpace cspace, float[] components, float alpha, Color[] alternativeColors, Color fallback)
      Creates a new color
      Parameters:
      cspace - the color space of the primary color
      components - the color components
      alpha - the alpha component
      alternativeColors - the array of alternative colors if applicable (may be null)
      fallback - the fallback color (usually an sRGB color)
    • ColorWithFallback

      public ColorWithFallback(Color color, Color fallback)
      Copy constructor adding a fallback color.
      Parameters:
      color - the color to be duplicated
      fallback - the fallback color (usually an sRGB color)
  • Method Details

    • getFallbackColor

      public Color getFallbackColor()
      Returns the fallback color.
      Returns:
      the fallback color
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
    • equals

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