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 BaseColor
BLACK
static BaseColor
BLUE
static BaseColor
CYAN
static BaseColor
DARK_GRAY
private static double
FACTOR
static BaseColor
GRAY
static BaseColor
GREEN
static BaseColor
LIGHT_GRAY
static BaseColor
MAGENTA
static BaseColor
ORANGE
static BaseColor
PINK
static BaseColor
RED
private int
value
static BaseColor
WHITE
static BaseColor
YELLOW
-
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 BaseColor
brighter()
Make this BaseColor brighter.BaseColor
darker()
Make this color darker.boolean
equals(java.lang.Object obj)
int
getAlpha()
int
getBlue()
int
getGreen()
int
getRed()
int
getRGB()
int
hashCode()
protected void
setValue(int red, int green, int blue, int alpha)
java.lang.String
toString()
private static void
validate(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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
toString
in classjava.lang.Object
-
-