spacing on custom icon widget

create color extension for random
widget 512x512 ... 1024x1024 didn't work
clean up Icon Widget View
This commit is contained in:
Trey t
2022-02-13 23:23:58 -06:00
parent 649180dbb5
commit b8e1198c5b
3 changed files with 25 additions and 22 deletions

View File

@@ -55,17 +55,9 @@ struct CreateIconView: View {
}
func createRandom() {
customIcon.bgColor = Color(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
customIcon.innerColor = Color(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
customIcon.bgColor = Color.random()
customIcon.innerColor = Color.random()
customIcon.bgOverlayColor = Color.random()
update(eye: .left, eyeOption: EyeOptions.allCases.randomElement()!)
update(eye: .right, eyeOption: EyeOptions.allCases.randomElement()!)
@@ -214,8 +206,8 @@ struct CreateIconView: View {
Button(action: {
let bigIconView = IconView(customIcon: customIcon, isPreview: false)
.frame(width: 1024, height: 1024, alignment: .center)
.aspectRatio(contentMode: .fit)
.frame(width: 512, height: 512, alignment: .center)
.aspectRatio(contentMode: .fill)
let icon = bigIconView.snapshot()
if let data = icon.pngData() {
savedCustomIcon = data