DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.39k stars 616 forks source link

Does not apply PdfColor in alpha #1643

Open michael-kim-korea opened 5 months ago

michael-kim-korea commented 5 months ago

Describe the bug When setting the color in Container's BoxDecoration, PdfColor.fromInt(0x00000000) is applied, but transparent is not applied to the screen and is displayed in black. However, it applies if you specify a color. PdfColor.fromInt(0x01FF0000) or PdfColor.fromInt(0x010000FF).

I don't know if this is a bug or intentional, but alpha is applied in the flutter widget.

To Reproduce pw.Container( width: 100.0, height: 100.0, decoration: pw.BoxDecoration( // color: PdfColor.fromInt(0x00000000), // not apply color: PdfColor.fromInt(0x01000000), // not apply // color: PdfColor.fromInt(0x010000FF), // alpha apply border: pw.Border.all(color: PdfColor.fromInt(0xFF00FF00)) ), child: Text("Test"), );

Desktop (please complete the following information):

image

DavBfr commented 4 months ago

Yes, there is no alpha component in PDF. Use the Opacity widget instead.