zxpsuper / qrcode-with-logos

A plugin for generating QR codes with a logo and styling.
https://zxpsuper.github.io/qrcode-with-logos
MIT License
130 stars 37 forks source link

Feature: Setting background and foreground colours #38

Closed AmoabaKelvin closed 2 weeks ago

zxpsuper commented 2 weeks ago

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

zxpsuper commented 2 weeks ago

@AmoabaKelvin It has been implemented! 😄

AmoabaKelvin commented 2 weeks ago

Super, thanks mate!

AmoabaKelvin commented 2 weeks ago

CleanShot 2024-07-10 at 09 19 18@2x Also it looks kinda blurry and not soo sharp, is there any reason for that @zxpsuper