This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var body: some View { | |
// Add this right after declaring body view: | |
UITableView.appearance().separatorColor = UIColor(red:(128/255), green:(128/255), blue:(128/255), alpha: 1) | |
return NavigationView{ | |
List {} | |
.navigationBarTitle("", displayMode: .inline) | |
.navigationBarHidden(true) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CGImage { | |
var isDark: Bool { | |
get { | |
guard let imageData = self.dataProvider?.data else { return false } | |
guard let ptr = CFDataGetBytePtr(imageData) else { return false } | |
let length = CFDataGetLength(imageData) | |
let threshold = Int(Double(self.width * self.height) * 0.45) | |
var darkPixels = 0 | |
for i in stride(from: 0, to: length, by: 4) { | |
let r = ptr[i] |