Package com.itextpdf.kernel.colors
Class DeviceGray
- java.lang.Object
-
- com.itextpdf.kernel.colors.Color
-
- com.itextpdf.kernel.colors.DeviceGray
-
public class DeviceGray extends Color
Color space to specify shades of gray color.
-
-
Field Summary
Fields Modifier and Type Field Description static DeviceGrayBLACKPredefined black DeviceGray color.static DeviceGrayGRAYPredefined gray DeviceGray color.static DeviceGrayWHITEPredefined white DeviceGray color.-
Fields inherited from class com.itextpdf.kernel.colors.Color
colorSpace, colorValue
-
-
Constructor Summary
Constructors Constructor Description DeviceGray()Creates DeviceGray color with grayscale value initialised as zero.DeviceGray(float value)Creates DeviceGray color by given grayscale.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DeviceGraymakeDarker(DeviceGray grayColor)ReturnsDeviceGraycolor which is darker than given onestatic DeviceGraymakeLighter(DeviceGray grayColor)ReturnsDeviceGraycolor 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
-
WHITE
public static final DeviceGray WHITE
Predefined white DeviceGray color.
-
GRAY
public static final DeviceGray GRAY
Predefined gray DeviceGray color.
-
BLACK
public static final DeviceGray BLACK
Predefined black DeviceGray color.
-
-
Constructor Detail
-
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 Detail
-
makeLighter
public static DeviceGray makeLighter(DeviceGray grayColor)
ReturnsDeviceGraycolor which is lighter than given one- Parameters:
grayColor- the DeviceGray color to be made lighter- Returns:
- lighter color
-
makeDarker
public static DeviceGray makeDarker(DeviceGray grayColor)
ReturnsDeviceGraycolor which is darker than given one- Parameters:
grayColor- the DeviceGray color to be made darker- Returns:
- darker color
-
-