Details
Description
Chosen transparency is ignored for annotation "Border Color", "Ink Color", and "Line Color".
Steps to reproduce:
1) Open sample PDF doc in Viewer RI and show the utility pane
2) Select any of the graphical tools (Line, Rectangle, Circle, or Ink Annotation)
3) Create an annotation anywhere on the page, and select it
4) Change line/border/ink color for the selected annotation, specifying alpha value less than 255: http://i.imgur.com/WeKkx5k.png
Expected behavior:
Annotation line/border/ink becomes partially transparent: http://i.imgur.com/oL4EeiX.png (mocked up).
Actual behavior:
Annotation line/border/ink remains fully opaque: http://i.imgur.com/KP1cBjD.png
Additional info:
Expected behavior is possible to achieve programmatically by extending SquareAnnotationHandler and setting lineColor field to a Color object with partial alpha.
Steps to reproduce:
1) Open sample PDF doc in Viewer RI and show the utility pane
2) Select any of the graphical tools (Line, Rectangle, Circle, or Ink Annotation)
3) Create an annotation anywhere on the page, and select it
4) Change line/border/ink color for the selected annotation, specifying alpha value less than 255: http://i.imgur.com/WeKkx5k.png
Expected behavior:
Annotation line/border/ink becomes partially transparent: http://i.imgur.com/oL4EeiX.png (mocked up).
Actual behavior:
Annotation line/border/ink remains fully opaque: http://i.imgur.com/KP1cBjD.png
Additional info:
Expected behavior is possible to achieve programmatically by extending SquareAnnotationHandler and setting lineColor field to a Color object with partial alpha.
Actually, it seems that the problem is in Annotation.setColor(...) rather than in the Viewer RI code. The first line of this method copies just the RGB components, and discards the alpha channel. So I was incorrect – it's not possible to work around this by extending AnnotationHandlers, since that would only fix the tool appearance, and not appearance of the actual annotation.