yellowQ-software / yellowQ-Flutter-Image-Painter

Flutter package for painting on images
MIT License
109 stars 118 forks source link

ImagePainterController _renderSignature() has hardcoded backgroundColor #91

Open jmcroset opened 1 month ago

jmcroset commented 1 month ago

Hi,

as per version 0.7, it seems that the backgroundColor of the rendered image is hardcoded to Colors.blue

Is there any reason for this, especially when there's a parameter signatureBgColor passed to the ImagePainter constructor, which, in that case, is not used ?

Best,

JM

Future<Uint8List?> _renderSignature() async { final recorder = ui.PictureRecorder(); final canvas = Canvas(recorder); SignaturePainter painter = SignaturePainter(controller: this, backgroundColor: Colors.blue);

Size size = Size(_rect.width, _rect.height);

painter.paint(canvas, size);
final _convertedImage = await recorder
    .endRecording()
    .toImage(size.width.floor(), size.height.floor());
final byteData =
    await _convertedImage.toByteData(format: ui.ImageByteFormat.png);
return byteData?.buffer.asUint8List();

}