Class PdfBoxGraphics2DColor

java.lang.Object
java.awt.Color
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DColor
All Implemented Interfaces:
IPdfBoxGraphics2DColor, Paint, Transparency, Serializable
Direct Known Subclasses:
PdfBoxGraphics2DCMYKColor

public class PdfBoxGraphics2DColor extends Color implements IPdfBoxGraphics2DColor
Universal PDColor Carrying class. It does not assume any specific colorspace. Useful for e.g. speration colors
See Also:
  • Field Details

    • color

      private final org.apache.pdfbox.pdmodel.graphics.color.PDColor color
    • alpha

      private final int alpha
    • overprint

      private final boolean overprint
  • Constructor Details

    • PdfBoxGraphics2DColor

      public PdfBoxGraphics2DColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor color)
      Parameters:
      color - the PDColor
    • PdfBoxGraphics2DColor

      public PdfBoxGraphics2DColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor color, int alpha)
      Parameters:
      color - the PDColor
      alpha - the alpha to use
    • PdfBoxGraphics2DColor

      public PdfBoxGraphics2DColor(org.apache.pdfbox.pdmodel.graphics.color.PDColor color, int alpha, boolean overprint)
      Parameters:
      color - the PDColor
      alpha - the alpha to use
      overprint - determine if overprint should be used
  • Method Details

    • toRGBValue

      private static int toRGBValue(org.apache.pdfbox.pdmodel.graphics.color.PDColor color, int alpha)
    • getAlpha

      public int getAlpha()
      Overrides:
      getAlpha in class Color
    • isOverprint

      public boolean isOverprint()
      Specified by:
      isOverprint in interface IPdfBoxGraphics2DColor
      Returns:
      true if this color should be applied with overprint
    • toPDColor

      public org.apache.pdfbox.pdmodel.graphics.color.PDColor toPDColor()
      Specified by:
      toPDColor in interface IPdfBoxGraphics2DColor
      Returns:
      the PDColor represented by this color object