Package com.itextpdf.text
Class BaseColor
- java.lang.Object
-
- com.itextpdf.text.BaseColor
-
- Direct Known Subclasses:
ExtendedColor
public class BaseColor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static BaseColorBLACKstatic BaseColorBLUEstatic BaseColorCYANstatic BaseColorDARK_GRAYprivate static doubleFACTORstatic BaseColorGRAYstatic BaseColorGREENstatic BaseColorLIGHT_GRAYstatic BaseColorMAGENTAstatic BaseColorORANGEstatic BaseColorPINKstatic BaseColorREDprivate intvaluestatic BaseColorWHITEstatic BaseColorYELLOW
-
Constructor Summary
Constructors Constructor Description BaseColor(float red, float green, float blue)Construct a BaseColor with float values.BaseColor(float red, float green, float blue, float alpha)Construct a BaseColor with float values.BaseColor(int argb)Construct a BaseColor by setting the combined value.BaseColor(int red, int green, int blue)BaseColor(int red, int green, int blue, int alpha)Construct a new BaseColor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseColorbrighter()Make this BaseColor brighter.BaseColordarker()Make this color darker.booleanequals(java.lang.Object obj)intgetAlpha()intgetBlue()intgetGreen()intgetRed()intgetRGB()inthashCode()protected voidsetValue(int red, int green, int blue, int alpha)java.lang.StringtoString()private static voidvalidate(int value)
-
-
-
Field Detail
-
WHITE
public static final BaseColor WHITE
-
LIGHT_GRAY
public static final BaseColor LIGHT_GRAY
-
GRAY
public static final BaseColor GRAY
-
DARK_GRAY
public static final BaseColor DARK_GRAY
-
BLACK
public static final BaseColor BLACK
-
RED
public static final BaseColor RED
-
PINK
public static final BaseColor PINK
-
ORANGE
public static final BaseColor ORANGE
-
YELLOW
public static final BaseColor YELLOW
-
GREEN
public static final BaseColor GREEN
-
MAGENTA
public static final BaseColor MAGENTA
-
CYAN
public static final BaseColor CYAN
-
BLUE
public static final BaseColor BLUE
-
FACTOR
private static final double FACTOR
- See Also:
- Constant Field Values
-
value
private int value
-
-
Constructor Detail
-
BaseColor
public BaseColor(int red, int green, int blue, int alpha)Construct a new BaseColor.- Parameters:
red- the value for the red gammagreen- the value for the green gammablue- the value for the blue gammaalpha- the value for the alpha gamma
-
BaseColor
public BaseColor(int red, int green, int blue)- Parameters:
red-green-blue-
-
BaseColor
public BaseColor(float red, float green, float blue, float alpha)Construct a BaseColor with float values.- Parameters:
red-green-blue-alpha-
-
BaseColor
public BaseColor(float red, float green, float blue)Construct a BaseColor with float values.- Parameters:
red-green-blue-
-
BaseColor
public BaseColor(int argb)
Construct a BaseColor by setting the combined value.- Parameters:
argb-
-
-
Method Detail
-
getRGB
public int getRGB()
- Returns:
- the combined color value
-
getRed
public int getRed()
- Returns:
- the value for red
-
getGreen
public int getGreen()
- Returns:
- the value for green
-
getBlue
public int getBlue()
- Returns:
- the value for blue
-
getAlpha
public int getAlpha()
- Returns:
- the value for the alpha channel
-
brighter
public BaseColor brighter()
Make this BaseColor brighter. Factor used is 0.7.- Returns:
- the new BaseColor
-
darker
public BaseColor darker()
Make this color darker. Factor used is 0.7- Returns:
- the new BaseColor
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setValue
protected void setValue(int red, int green, int blue, int alpha)
-
validate
private static void validate(int value)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-