Package org.apache.fop.util
Class ColorWithFallback
- java.lang.Object
-
- java.awt.Color
-
- org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
-
- org.apache.fop.util.ColorWithFallback
-
- All Implemented Interfaces:
java.awt.Paint
,java.awt.Transparency
,java.io.Serializable
public class ColorWithFallback extends org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
This class is aColor
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ColorWithFallback(java.awt.color.ColorSpace cspace, float[] components, float alpha, java.awt.Color[] alternativeColors, java.awt.Color fallback)
Creates a new colorColorWithFallback(java.awt.Color color, java.awt.Color fallback)
Copy constructor adding a fallback color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.awt.Color
getFallbackColor()
Returns the fallback color.int
hashCode()
-
Methods inherited from class org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
getAlternativeColors, getFirstAlternativeOfType, hasAlternativeColors, hasSameAlternativeColors
-
Methods inherited from class java.awt.Color
brighter, createContext, darker, decode, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, HSBtoRGB, RGBtoHSB, toString
-
-
-
-
Constructor Detail
-
ColorWithFallback
public ColorWithFallback(java.awt.color.ColorSpace cspace, float[] components, float alpha, java.awt.Color[] alternativeColors, java.awt.Color fallback)
Creates a new color- Parameters:
cspace
- the color space of the primary colorcomponents
- the color componentsalpha
- the alpha componentalternativeColors
- the array of alternative colors if applicable (may be null)fallback
- the fallback color (usually an sRGB color)
-
ColorWithFallback
public ColorWithFallback(java.awt.Color color, java.awt.Color fallback)
Copy constructor adding a fallback color.- Parameters:
color
- the color to be duplicatedfallback
- the fallback color (usually an sRGB color)
-
-
Method Detail
-
getFallbackColor
public java.awt.Color getFallbackColor()
Returns the fallback color.- Returns:
- the fallback color
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classorg.apache.xmlgraphics.java2d.color.ColorWithAlternatives
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.awt.Color
-
-