Color implements Serializable { public static DeviceRgb convertCmykToRgb(DeviceCmyk cmykColor) { float cyanComp = 1 - cmykColor.getColorValue()[0]; float magentaComp = 1 - cmykColor.getColorValue()[1]; float yellowComp = 1 - cmykColor.getColorValue()[2]; float blackComp = 1 - cmykColor.getColorValue()[3]; float r = cyanComp * blackComp; float g = magentaComp * blackComp; float b = yellowComp * blackComp; return new DeviceRgb(r, g, b); } protected  Color(PdfColorSpace colorSpace, float[] colorValue); static Color makeColor(PdfColorSpace colorSpace); static Color makeColor(PdfColorSpace colorSpace, float[] colorValue); static DeviceRgb convertCmykToRgb(DeviceCmyk cmykColor); static DeviceCmyk convertRgbToCmyk(DeviceRgb rgbColor); int getNumberOfComponents(); PdfColorSpace getColorSpace(); float[] getColorValue(); void setColorValue(float[] value); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void convertCmykToRgbTest() { DeviceCmyk cmyk = new DeviceCmyk(0, 0, 0, 0); DeviceRgb rgb = new DeviceRgb(255, 255, 255); Assert.assertArrayEquals(rgb.colorValue, Color.convertCmykToRgb(cmyk).colorValue, EPS); }