zxpsuper/qrcode-with-logos

Option to change background color

jayademola opened this issue · 2 comments

This issue proposes adding a setting to allow users to change the background color and/or image to their preference.

This issue proposes adding a setting to allow users to change the background color and/or image to their preference.

It has been implemented! You can set nodeQrCodeOptions.color to change background and foreground colours.
For example:

new QrCodeWithLogo({
  canvas: document.getElementById("canvas"),
  content: "https://github.com/zxpsuper",
  width: 380,
  logo: {
    src: "https://avatars1.githubusercontent.com/u/28730619?s=460&v=4"
  },
  nodeQrCodeOptions: {
    color: {
        light: "#eee",
        dark: "#f00"
      }
  },
  cornersOptions: {},
  dotsOptions: {}
})

The result is that:
image

Background image is not support now!