Open timbru31 opened 3 years ago
It would be a great addition to allow users to create a different colored QR codes - this is especially useful if you plan to show the code in dark mode for instance and want to invert the colors.
From looking at the code, it seems the used MatrixToImageWriter supports passing in a custom MatrixToImageConfig object, which defines the ON and OFF colors used to create the image. See https://zxing.github.io/zxing/apidocs/com/google/zxing/client/j2se/MatrixToImageWriter.html#writeToStream-com.google.zxing.common.BitMatrix-java.lang.String-java.io.OutputStream-com.google.zxing.client.j2se.MatrixToImageConfig- and https://zxing.github.io/zxing/apidocs/com/google/zxing/client/j2se/MatrixToImageConfig.html
MatrixToImageWriter
MatrixToImageConfig
(Yes I know I could just create a custom ZxingPngQrGenerator like class to change things)
It would be a great addition to allow users to create a different colored QR codes - this is especially useful if you plan to show the code in dark mode for instance and want to invert the colors.
From looking at the code, it seems the used
MatrixToImageWriter
supports passing in a customMatrixToImageConfig
object, which defines the ON and OFF colors used to create the image. See https://zxing.github.io/zxing/apidocs/com/google/zxing/client/j2se/MatrixToImageWriter.html#writeToStream-com.google.zxing.common.BitMatrix-java.lang.String-java.io.OutputStream-com.google.zxing.client.j2se.MatrixToImageConfig- and https://zxing.github.io/zxing/apidocs/com/google/zxing/client/j2se/MatrixToImageConfig.html