Skip to content

Commit 1c94222

Browse files
authored
remove qrcode inverting (#47)
1 parent c523dc2 commit 1c94222

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.2] - unreleased
9+
10+
### Removed
11+
* Removed QRCode inverting #APPS-1230
12+
813
## [1.1.1] - 2023-05-23
914

1015
### Updated

Example/SnabblePayExample/Views/QRCodeView.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ struct QRCodeView: View {
2323
.interpolation(.none)
2424
.resizable()
2525
.scaledToFit()
26+
.background(Color.white)
27+
.cornerRadius(4.0)
2628
}
2729
}
2830

@@ -36,21 +38,10 @@ private extension String {
3638
let maskFilter = CIFilter.blendWithMask()
3739
maskFilter.maskImage = outputImage.applyingFilter("CIColorInvert")
3840

39-
// create a version of the code with black foreground...
4041
maskFilter.inputImage = CIImage(color: .black)
4142
let blackCIImage = maskFilter.outputImage!
42-
// ... and one with white foreground
43-
maskFilter.inputImage = CIImage(color: .white)
44-
let whiteCIImage = maskFilter.outputImage!
4543

46-
// render both images
4744
let blackImage = context.createCGImage(blackCIImage, from: blackCIImage.extent).map(UIImage.init)!
48-
let whiteImage = context.createCGImage(whiteCIImage, from: whiteCIImage.extent).map(UIImage.init)!
49-
50-
// use black version for light mode
51-
// let qrImage = UIImage(cgImage: blackImage)
52-
// assign the white version to be used in dark mode
53-
blackImage.imageAsset?.register(whiteImage, with: UITraitCollection(userInterfaceStyle: .dark))
5445

5546
return blackImage
5647
}

0 commit comments

Comments
 (0)