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
FieldsModifier and TypeFieldDescriptionstatic final DeviceGrayPredefined black DeviceGray color.static final DeviceGrayPredefined gray DeviceGray color.static final DeviceGrayPredefined white DeviceGray color.Fields inherited from class com.itextpdf.kernel.colors.Color
colorSpace, colorValue -
Constructor Summary
ConstructorsConstructorDescriptionCreates DeviceGray color with grayscale value initialised as zero.DeviceGray(float value) Creates DeviceGray color by given grayscale. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeviceGraymakeDarker(DeviceGray grayColor) ReturnsDeviceGraycolor which is darker than given onestatic DeviceGraymakeLighter(DeviceGray grayColor) ReturnsDeviceGraycolor 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
ReturnsDeviceGraycolor which is lighter than given one- Parameters:
-
grayColor- the DeviceGray color to be made lighter - Returns:
- lighter color
-
makeDarker
ReturnsDeviceGraycolor which is darker than given one- Parameters:
-
grayColor- the DeviceGray color to be made darker - Returns:
- darker color
-