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

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

Introduction

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

Prototype

public DeviceRgb(float r, float g, float b) 

Source Link

Document

Creates DeviceRgb color by intensities of red, green and blue 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  .  jav a  2 s  .co m
        return new DeviceRgb(color.getRed(), color.getGreen(), color.getBlue());

    }
}