Giter Site home page Giter Site logo

Comments (3)

waelsaad avatar waelsaad commented on May 18, 2024 1

Hi @dagronf thank you so much for the response and correcting the code, its exactly what I was looking for and I'll be looking into the Bitmap. Kind Regards.

from qrcode.

dagronf avatar dagronf commented on May 18, 2024

Hi @waelsaad,

was wondering if there's a more concise or elegant way to achieve the same result.

If you're not targeting watchOS, you can (probably) just use the default QR code generator instead of specifying the external generator.

let d = QRCode.Document(generator: QRCodeGenerator_External())
d.errorCorrection = .high
d.utf8String = "https://www.swift.org"

becomes

let d = QRCode.Document(utf8String: "https://www.swift.org", errorCorrection, .high)

also how to use circle center (QRCode.LogoTemplate.CircleCenter)

let document: QRCode.Document = {
   let d = QRCode.Document(utf8String: "https://www.swift.org", errorCorrection, .high)
   d.logoTemplate = QRCode.LogoTemplate.CircleCenter(image: myImage, inset: 3)
   return d
}()

How can I change the tint color of the centered logo

Tinting images is not part of this library. I have another library called Bitmap which has the ability to tint an image

guard 
   let orig = CGImage.named("verified_user"),
   let tintedImage = try? Bitmap(orig)
      .tinting(with: CGColor(red: 0, green: 0, blue: 1, alpha: 1)
      .cgImage
else {
   // handle error
}

If you're not keen to add another library to your code, you can look through the Bitmap source code for tinting.

Hope this helps!

from qrcode.

dagronf avatar dagronf commented on May 18, 2024

Brilliant mate. Glad I can help.

from qrcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.