Example usage for com.itextpdf.kernel.colors DeviceCmyk DeviceCmyk

List of usage examples for com.itextpdf.kernel.colors DeviceCmyk DeviceCmyk

Introduction

In this page you can find the example usage for com.itextpdf.kernel.colors DeviceCmyk DeviceCmyk.

Prototype

public DeviceCmyk(float c, float m, float y, float k) 

Source Link

Document

Creates DeviceCmyk color by intensities of cyan, magenta, yellow and black colorants.

Usage

From source file:org.reactome.server.tools.diagram.exporter.raster.itext.awt.PdfGraphics2D.java

License:Open Source License

private static com.itextpdf.kernel.colors.Color prepareColor(Color color) {
    if (color.getColorSpace().getType() == ColorSpace.TYPE_CMYK) {
        float[] comp = color.getColorComponents(null);
        return new DeviceCmyk(comp[0], comp[1], comp[2], comp[3]);
    } else {/*from w w  w.  ja  v  a2s  . c om*/
        return new DeviceRgb(color.getRed(), color.getGreen(), color.getBlue());

    }
}