Class DeviceGray


  • public class DeviceGray
    extends Color
    Color space to specify shades of gray color.
    • 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)
        Returns DeviceGray color 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)
        Returns DeviceGray color which is darker than given one
        Parameters:
        grayColor - the DeviceGray color to be made darker
        Returns:
        darker color