Comments (3)
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.
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.
Brilliant mate. Glad I can help.
from qrcode.
Related Issues (20)
- Enhancement suggestion: SVG images for examples HOT 9
- Enhancement suggestion: Quiet zone width option HOT 5
- Example question HOT 4
- New shiny pixel shape renders off center HOT 3
- Adding a logo template inset after creating a template seems not to affect created mask size HOT 6
- How to not import QRCode reader HOT 5
- VideoDetector does not work in new pod version HOT 4
- Localizable.string breaks application localization HOT 2
- No such module 'SwiftImageReadWrite' HOT 1
- Runtime crash HOT 7
- Build QRCode as an SDK dependency HOT 6
- building out to device HOT 3
- If a QRCode has a non-square dimension _and_ a logotemplate, the logo draws out of location
- Are there any version that support for iOS 12.0? HOT 4
- support for iOS 11 HOT 2
- Missing architecture HOT 4
- how to Integrate Deeplink info QR HOT 2
- Upload Privacy Manifest HOT 3
- Error correction: off HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrcode.