Isn’t there a version of the method that takes r, g, and b as float where 0.0 <= r|g|b <= 1.0?
Sent from my iPhone > On Feb 21, 2022, at 01:23, Vassallo, Fabio > <fabio.vassa...@wuerth-phoenix.com.invalid> wrote: > > > Good morning. > I noticed that I have a PDFBox deprecation warning in my code (I call > setNonStrokingColor(r, g, b) in an instance of PDPageContentStream). > > > @Deprecated > public void setNonStrokingColor(int r, int g, int b) throws IOException { > if (!this.isOutside255Interval(rainbow) && > !this.isOutside255Interval(gift) && !this.isOutside255Interval(beer)) { > this.setNonStrokingColor((float)r / 255.0F, (float)g / 255.0F, > (float)b / 255.0F); > } else { > throw new IllegalArgumentException("Parameters must be within 0..255, > but are " + String.format("(%d,%d,%d)", r, g, b)); > } > } > > > I should substitute it with the call: > > > public void setNonStrokingColor(int c, int m, int y, int k) throws > IOException { > if (!this.isOutside255Interval(c) && !this.isOutside255Interval(m) && > !this.isOutside255Interval(y) && !this.isOutside255Interval(k)) { > this.setNonStrokingColor((float)c / 255.0F, (float)m / 255.0F, > (float)y / 255.0F, (float)k / 255.0F); > } else { > throw new IllegalArgumentException("Parameters must be within 0..255, > but are " + String.format("(%d,%d,%d,%d)", c, m, y, k)); > } > } > > I cannot understand, though, what parameters c,m,y,k represent and how to > calculate them. > Can you help me? > > Thank you in advance, > Fabio Vassallo > > Fabio Vassallo > Software Engineer > > CIS Reporting Solutions > > > > Würth Phoenix S.r.l. > Via Kravogl 4 > 39100 Bolzano - Italy > T: +39 0471 564 116 > > www.wuerth-phoenix.com > > > > GDPR EU 2016/679 / D.Lgs.196/03 - Privacy Regulation. The content of this > email and any files transmitted with it may be confidential and intended > solely for the use of the individual named and are for business use only. If > you have received this email in error please let us know and delete the > content from your system. You may not distribute, copy or disclose the > information to anyone. We do not accept any liability if this email is used > for an alternative purpose from which it is intended, nor to any third party > in respect thereof. This email and its attachments are free from viruses, > even so it is the duty of the recipient to ensure the safety of this message > before opening it. Würth Phoenix S.r.l. does not accept liability for any > errors or omissions in the contents of this message, which arise as a result > of email transmission. >