/** * Creates an uncalibrated CMYK color with the given gray value. * @param black the gray component (0 - 1) * @return the CMYK color */ public static Color toCMYKGrayColor(float black) { return org.apache.xmlgraphics.java2d.color.ColorUtil.toCMYKGrayColor(black); } }
/** * The color is converted to CMYK with just the K component. * {@inheritDoc} */ public Color convert(Color color) { float kValue = (RED_WEIGHT * color.getRed() + GREEN_WEIGTH * color.getGreen() + BLUE_WEIGHT * color.getBlue()) / 255.0f / 255.0f; return ColorUtil.toCMYKGrayColor(kValue); } }