Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] spotcolor getAlternativeCS() and tint problem

Bodo

2005-05-18


hi,
i use itexts PdfGraphics2D.setColor(Color color) the following way:
int tint = 0.5f;
Color altColor = new Color(255,255, 0);        
PdfSpotColor pdfSpotC =
     new PdfSpotColor("myspotcolorname",tint,altColor);
SpotColor col = new SpotColor(pdfSpotC);
PdfGraphics2D.setColor(col ) ;

if tint=1 i expect to get see the altColor without any change, which is indeed
what i see in Acroreader so far so good.


but the smaller the tint value gets the darker looks the color in AcrobatReader.
but instead i expected the contrary: the smaller the tint value the lighter the
color should look like (at least if the backgroundcolor is white)

looking into the source we see:

  public SpotColor(PdfSpotColor spot, float tint) {
    super(TYPE_SEPARATION,
       (float)spot.getAlternativeCS().getRed() / 255f * tint,
       (float)spot.getAlternativeCS().getGreen() / 255f * tint,
       (float)spot.getAlternativeCS().getBlue() / 255f * tint);
    this.spot = spot;
    this.tint = tint;
  }

but i suspect this is not correkt. instead of multipying the rgb values with
tint i guess, one should multiply the cmyk values with tint, right?


see also http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_12894
where it is explained that a smaller tint would lead to a lighter color.

so is this a bug in itext or did i missanderstand something here?

bodo




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.