Package com.itextpdf.kernel.colors
Class DeviceGray
java.lang.Object
com.itextpdf.kernel.colors.Color
com.itextpdf.kernel.colors.DeviceGray
Color space to specify shades of gray color.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DeviceGray
Predefined black DeviceGray color.static final DeviceGray
Predefined gray DeviceGray color.static final DeviceGray
Predefined white DeviceGray color.Fields inherited from class com.itextpdf.kernel.colors.Color
colorSpace, colorValue
-
Constructor Summary
ConstructorDescriptionCreates DeviceGray color with grayscale value initialised as zero.DeviceGray
(float value) Creates DeviceGray color by given grayscale. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceGray
makeDarker
(DeviceGray grayColor) ReturnsDeviceGray
color which is darker than given onestatic DeviceGray
makeLighter
(DeviceGray grayColor) ReturnsDeviceGray
color which is lighter than given oneMethods inherited from class com.itextpdf.kernel.colors.Color
convertCmykToRgb, convertRgbToCmyk, createColorWithColorSpace, equals, getColorSpace, getColorValue, getNumberOfComponents, hashCode, makeColor, makeColor, setColorValue
-
Field Details
-
WHITE
Predefined white DeviceGray color. -
GRAY
Predefined gray DeviceGray color. -
BLACK
Predefined black DeviceGray color.
-
-
Constructor Details
-
DeviceGray
public DeviceGray(float value) Creates DeviceGray color by given grayscale. The grayscale is considered to be in [0, 1] interval, if not, the grayscale will be considered as 1 (when grayscale's value is bigger than 1) or 0 (when grayscale's value is less than 0).- Parameters:
-
value
- the grayscale value
-
DeviceGray
public DeviceGray()Creates DeviceGray color with grayscale value initialised as zero.
-
-
Method Details
-
makeLighter
ReturnsDeviceGray
color which is lighter than given one- Parameters:
-
grayColor
- the DeviceGray color to be made lighter - Returns:
- lighter color
-
makeDarker
ReturnsDeviceGray
color which is darker than given one- Parameters:
-
grayColor
- the DeviceGray color to be made darker - Returns:
- darker color
-