Package com.itextpdf.kernel.colors
Class DeviceRgb
- java.lang.Object
-
- com.itextpdf.kernel.colors.Color
-
- com.itextpdf.kernel.colors.DeviceRgb
-
public class DeviceRgb extends Color
Color space to specify colors according to RGB color model.
-
-
Field Summary
Fields Modifier and Type Field Description static ColorBLACKPredefined black DeviceRgb colorstatic ColorBLUEPredefined blue DeviceRgb colorstatic ColorGREENPredefined green DeviceRgb colorstatic ColorREDPredefined red DeviceRgb colorstatic ColorWHITEPredefined white DeviceRgb color-
Fields inherited from class com.itextpdf.kernel.colors.Color
colorSpace, colorValue
-
-
Constructor Summary
Constructors Constructor Description DeviceRgb()Creates DeviceRgb color with all colorants intensities initialised as zeroes.DeviceRgb(float r, float g, float b)Creates DeviceRgb color by intensities of red, green and blue colorants.DeviceRgb(int r, int g, int b)Creates DeviceRgb color by intensities of red, green and blue colorants.DeviceRgb(java.awt.Color color)Create DeviceRGB color from R, G, B values of java.awt.Color
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DeviceRgbmakeDarker(DeviceRgb rgbColor)ReturnsDeviceRgbcolor which is darker than given onestatic DeviceRgbmakeLighter(DeviceRgb rgbColor)ReturnsDeviceRgbcolor which is lighter than given one-
Methods inherited from class com.itextpdf.kernel.colors.Color
convertCmykToRgb, convertRgbToCmyk, createColorWithColorSpace, equals, getColorSpace, getColorValue, getNumberOfComponents, hashCode, makeColor, makeColor, setColorValue
-
-
-
-
Field Detail
-
BLACK
public static final Color BLACK
Predefined black DeviceRgb color
-
WHITE
public static final Color WHITE
Predefined white DeviceRgb color
-
RED
public static final Color RED
Predefined red DeviceRgb color
-
GREEN
public static final Color GREEN
Predefined green DeviceRgb color
-
BLUE
public static final Color BLUE
Predefined blue DeviceRgb color
-
-
Constructor Detail
-
DeviceRgb
public DeviceRgb(int r, int g, int b)Creates DeviceRgb color by intensities of red, green and blue colorants. The intensities are considered to be in [0, 255] gap, if not, the intensity will be considered as 255 (when colorant's value is bigger than 255) or 0 (when colorant's value is less than 0).- Parameters:
r- the intensity of red colorantg- the intensity of green colorantb- the intensity of blue colorant
-
DeviceRgb
public DeviceRgb(float r, float g, float b)Creates DeviceRgb color by intensities of red, green and blue colorants. The intensities are considered to be in [0, 1] interval, if not, the intensity will be considered as 1 (when colorant's value is bigger than 1) or 0 (when colorant's value is less than 0).- Parameters:
r- the intensity of red colorantg- the intensity of green colorantb- the intensity of blue colorant
-
DeviceRgb
public DeviceRgb(java.awt.Color color)
Create DeviceRGB color from R, G, B values of java.awt.ColorNote, that alpha chanel is ignored, but opacity still can be achieved in some places by using 'setOpacity' method or 'TransparentColor' class.
- Parameters:
color- the color which RGB values are used
-
DeviceRgb
public DeviceRgb()
Creates DeviceRgb color with all colorants intensities initialised as zeroes.
-
-