So, this is my workaround:

g.setColor(getBlendedColor(bgColor, fgColor, 25));
g.fill(new Rectangle2D.Double(x1,y1,w1,h1));
g.setColor(fgColor);


Color getBlendedColor(Color bg, Color fg, int transp)
{
  BufferedImage image = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g2 = image.createGraphics();
  g2.setPaint(bg);
  g2.fill(new Rectangle2D.Float(0,0,1,1));
  g2.setPaint(new Color(fg.getRed(),fg.getGreen(),fg.getBlue(),transp));
  g2.fill(new Rectangle2D.Float(0,0,1,1));
  g2.dispose();
  return new Color(image.getRGB(0, 0));
}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to