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:
-
Field Summary
FieldsFields inherited from class Color
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOWFields inherited from interface Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionColorWithFallback(ColorSpace cspace, float[] components, float alpha, Color[] alternativeColors, Color fallback) Creates a new colorColorWithFallback(Color color, Color fallback) Copy constructor adding a fallback color. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate static floatgetAlphaFloat(Color color) private static Color[]getAlternativeColors(Color color) Returns the fallback color.inthashCode()Methods inherited from class org.apache.xmlgraphics.java2d.color.ColorWithAlternatives
getAlternativeColors, getFirstAlternativeOfType, hasAlternativeColors, hasSameAlternativeColorsMethods inherited from class 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
fallback
-
-
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 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
-
-
Method Details
-
getAlphaFloat
-
getAlternativeColors
-
getFallbackColor
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.apache.xmlgraphics.java2d.color.ColorWithAlternatives
-
equals
-