You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Holger Herrmann (Jira)" <ji...@apache.org> on 2022/09/02 12:39:00 UTC

[jira] [Resolved] (PDFBOX-5498) Setting NonStrokingColor with RGB checks wrong color ranges

     [ https://issues.apache.org/jira/browse/PDFBOX-5498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holger Herrmann resolved PDFBOX-5498.
-------------------------------------
    Fix Version/s: 3.0.0 PDFBox
       Resolution: Not A Bug

Clarified, see comments.

> Setting NonStrokingColor with RGB checks wrong color ranges
> -----------------------------------------------------------
>
>                 Key: PDFBOX-5498
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5498
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Holger Herrmann
>            Priority: Minor
>              Labels: Color, Font
>             Fix For: 3.0.0 PDFBox
>
>
> In the PDAbstractContentStream, you can set the NonStrokingColor by passing RGB values.
> However, these values may only be 0 or 1, as they are checked with isOutsideOneInterval():
>  
> {{public void setNonStrokingColor(float r, float g, float b) throws IOException {}}
> {{   if (isOutsideOneInterval(r) || isOutsideOneInterval(g) || isOutsideOneInterval(b))}}
> {{   {}}
> {{      throw new IllegalArgumentException("Parameters must be within 0..1, but are "}}
> {{      + String.format("(%.2f,%.2f,%.2f)", r, g, b));}}
> {{   }}}
> {{   ...}}
> {{}}}
>  
> {{The comment of the method seems correct to me: "Range is 0..255."}}
>  
> {{So I suppose the values have to be checked using isOutside255Interval(.).}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org