Example usage for com.itextpdf.text.pdf PdfContentByte setRGBColorFillF

List of usage examples for com.itextpdf.text.pdf PdfContentByte setRGBColorFillF

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfContentByte setRGBColorFillF.

Prototype


public void setRGBColorFillF(final float red, final float green, final float blue) 

Source Link

Document

Changes the current color for filling paths (device dependent colors!).

Usage

From source file:mkl.testarea.itext5.pdfcleanup.StrictPdfCleanUpProcessor.java

License:Open Source License

private void setFillColor(PdfContentByte canvas, List fillColorArgs) {
    switch (fillColorArgs.size()) {
    case 1:/*from   ww  w.  j  a v a 2  s  . c  o m*/
        canvas.setGrayFill(((PdfNumber) fillColorArgs.get(0)).floatValue());
        break;

    case 3:
        canvas.setRGBColorFillF(((PdfNumber) fillColorArgs.get(0)).floatValue(),
                ((PdfNumber) fillColorArgs.get(1)).floatValue(),
                ((PdfNumber) fillColorArgs.get(2)).floatValue());
        break;

    case 4:
        canvas.setCMYKColorFillF(((PdfNumber) fillColorArgs.get(0)).floatValue(),
                ((PdfNumber) fillColorArgs.get(1)).floatValue(),
                ((PdfNumber) fillColorArgs.get(2)).floatValue(),
                ((PdfNumber) fillColorArgs.get(3)).floatValue());
        break;

    }
}