Package com.itextpdf.kernel.colors
Class DeviceRgb
java.lang.Object
com.itextpdf.kernel.colors.Color
com.itextpdf.kernel.colors.DeviceRgb
Color space to specify colors according to RGB color model.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Color
Predefined black DeviceRgb colorstatic final Color
Predefined blue DeviceRgb colorstatic final Color
Predefined green DeviceRgb colorstatic final Color
Predefined red DeviceRgb colorstatic final Color
Predefined white DeviceRgb colorFields inherited from class com.itextpdf.kernel.colors.Color
colorSpace, colorValue
-
Constructor Summary
ConstructorDescriptionCreates 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.Create DeviceRGB color from R, G, B values of java.awt.Color -
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceRgb
makeDarker
(DeviceRgb rgbColor) ReturnsDeviceRgb
color which is darker than given onestatic DeviceRgb
makeLighter
(DeviceRgb rgbColor) ReturnsDeviceRgb
color which is lighter than given oneMethods inherited from class com.itextpdf.kernel.colors.Color
convertCmykToRgb, convertRgbToCmyk, equals, getColorSpace, getColorValue, getNumberOfComponents, hashCode, makeColor, makeColor, setColorValue
-
Field Details
-
BLACK
Predefined black DeviceRgb color -
WHITE
Predefined white DeviceRgb color -
RED
Predefined red DeviceRgb color -
GREEN
Predefined green DeviceRgb color -
BLUE
Predefined blue DeviceRgb color
-
-
Constructor Details
-
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 colorant -
g
- the intensity of green colorant -
b
- 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 colorant -
g
- the intensity of green colorant -
b
- the intensity of blue colorant
-
DeviceRgb
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.
-
-
Method Details
-
makeLighter
ReturnsDeviceRgb
color which is lighter than given one- Parameters:
-
rgbColor
- the DeviceRgb color to be made lighter - Returns:
- lighter color
-
makeDarker
ReturnsDeviceRgb
color which is darker than given one- Parameters:
-
rgbColor
- the DeviceRgb color to be made darker - Returns:
- darker color
-