customize eye, mouth, face outline colors for custom icon
This commit is contained in:
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
"info" : {
|
"info" : {
|
||||||
"author" : "xcode",
|
"author" : "xcode",
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,12 @@ class CustomIcon: ObservableObject {
|
|||||||
background: [(Image, UUID)],
|
background: [(Image, UUID)],
|
||||||
bgColor: Color,
|
bgColor: Color,
|
||||||
innerColor: Color,
|
innerColor: Color,
|
||||||
bgOverlayColor: Color) {
|
bgOverlayColor: Color,
|
||||||
|
rightEyeColor: Color,
|
||||||
|
leftEyeColor: Color,
|
||||||
|
mouthColor: Color,
|
||||||
|
circleStrokeColor: Color
|
||||||
|
) {
|
||||||
self.leftEye = leftEye
|
self.leftEye = leftEye
|
||||||
self.rightEye = rightEye
|
self.rightEye = rightEye
|
||||||
self.mouth = mouth
|
self.mouth = mouth
|
||||||
@@ -24,6 +29,10 @@ class CustomIcon: ObservableObject {
|
|||||||
self.bgColor = bgColor
|
self.bgColor = bgColor
|
||||||
self.innerColor = innerColor
|
self.innerColor = innerColor
|
||||||
self.bgOverlayColor = bgOverlayColor
|
self.bgOverlayColor = bgOverlayColor
|
||||||
|
self.rightEyeColor = rightEyeColor
|
||||||
|
self.leftEyeColor = leftEyeColor
|
||||||
|
self.mouthColor = mouthColor
|
||||||
|
self.circleStrokeColor = circleStrokeColor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published var leftEye: Image
|
@Published var leftEye: Image
|
||||||
@@ -34,6 +43,12 @@ class CustomIcon: ObservableObject {
|
|||||||
@Published var bgColor: Color
|
@Published var bgColor: Color
|
||||||
@Published var innerColor: Color
|
@Published var innerColor: Color
|
||||||
@Published var bgOverlayColor: Color
|
@Published var bgOverlayColor: Color
|
||||||
|
|
||||||
|
@Published var leftEyeColor: Color
|
||||||
|
@Published var rightEyeColor: Color
|
||||||
|
@Published var mouthColor: Color
|
||||||
|
|
||||||
|
@Published var circleStrokeColor: Color
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BackGroundOptions: String, CaseIterable {
|
enum BackGroundOptions: String, CaseIterable {
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ struct CreateIconView: View {
|
|||||||
background: CreateIconView.iconViewBGs,
|
background: CreateIconView.iconViewBGs,
|
||||||
bgColor: .red,
|
bgColor: .red,
|
||||||
innerColor: .green,
|
innerColor: .green,
|
||||||
bgOverlayColor: .black)
|
bgOverlayColor: .black,
|
||||||
|
rightEyeColor: .orange,
|
||||||
|
leftEyeColor: .yellow,
|
||||||
|
mouthColor: .green,
|
||||||
|
circleStrokeColor: .pink)
|
||||||
private var randomElements: [AnyView] = [
|
private var randomElements: [AnyView] = [
|
||||||
AnyView(Image(BackGroundOptions.selectable.randomElement()!.rawValue)
|
AnyView(Image(BackGroundOptions.selectable.randomElement()!.rawValue)
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -113,51 +117,83 @@ struct CreateIconView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
VStack {
|
ZStack {
|
||||||
ColorPicker("Set the background color", selection: $customIcon.bgColor)
|
Color(theme.currentTheme.secondaryBGColor)
|
||||||
.padding([.leading, .trailing])
|
HStack {
|
||||||
ColorPicker("Set the inner color", selection: $customIcon.innerColor)
|
Spacer()
|
||||||
.padding([.leading, .trailing])
|
VStack(alignment: .center) {
|
||||||
|
Text("background")
|
||||||
|
ColorPicker("", selection: $customIcon.bgColor)
|
||||||
|
.labelsHidden()
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
VStack(alignment: .center) {
|
||||||
|
Text("Inner")
|
||||||
|
ColorPicker("", selection: $customIcon.innerColor)
|
||||||
|
.labelsHidden()
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
VStack(alignment: .center) {
|
||||||
|
Text("Face Outline")
|
||||||
|
ColorPicker("", selection: $customIcon.circleStrokeColor)
|
||||||
|
.labelsHidden()
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.frame(height: 75)
|
||||||
|
.frame(minWidth: 0, maxWidth: .infinity)
|
||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(theme.currentTheme.secondaryBGColor)
|
Color(theme.currentTheme.secondaryBGColor)
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
Menu("Left Eye") {
|
VStack {
|
||||||
ForEach(EyeOptions.allCases, id: \.self) { option in
|
Menu("Left Eye") {
|
||||||
Button(action: {
|
ForEach(EyeOptions.allCases, id: \.self) { option in
|
||||||
update(eye: .left, eyeOption: option)
|
Button(action: {
|
||||||
}, label: {
|
update(eye: .left, eyeOption: option)
|
||||||
Label(option.rawValue, image: option.rawValue)
|
}, label: {
|
||||||
})
|
Label(option.rawValue, image: option.rawValue)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
ColorPicker("", selection: $customIcon.leftEyeColor)
|
||||||
|
.labelsHidden()
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Menu("Right Eye") {
|
VStack {
|
||||||
ForEach(EyeOptions.allCases, id: \.self) { option in
|
Menu("Right Eye") {
|
||||||
Button(action: {
|
ForEach(EyeOptions.allCases, id: \.self) { option in
|
||||||
update(eye: .right, eyeOption: option)
|
Button(action: {
|
||||||
}, label: {
|
update(eye: .right, eyeOption: option)
|
||||||
Label(option.rawValue, image: option.rawValue)
|
}, label: {
|
||||||
})
|
Label(option.rawValue, image: option.rawValue)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
ColorPicker("", selection: $customIcon.rightEyeColor)
|
||||||
|
.labelsHidden()
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Menu("Mouth") {
|
VStack {
|
||||||
ForEach(MouthOptions.allCases, id: \.self) { option in
|
Menu("Mouth") {
|
||||||
Button(action: {
|
ForEach(MouthOptions.allCases, id: \.self) { option in
|
||||||
update(mouthOption: option)
|
Button(action: {
|
||||||
}, label: {
|
update(mouthOption: option)
|
||||||
Label(option.rawValue, image: option.rawValue)
|
}, label: {
|
||||||
})
|
Label(option.rawValue, image: option.rawValue)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
ColorPicker("", selection: $customIcon.mouthColor)
|
||||||
|
.labelsHidden()
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: 44)
|
.frame(height: 75)
|
||||||
.padding(.top, 10)
|
.frame(minWidth: 0, maxWidth: .infinity)
|
||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(theme.currentTheme.secondaryBGColor)
|
Color(theme.currentTheme.secondaryBGColor)
|
||||||
@@ -185,9 +221,8 @@ struct CreateIconView: View {
|
|||||||
.padding([.leading, .trailing])
|
.padding([.leading, .trailing])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(height: 88)
|
.frame(height: 75)
|
||||||
.frame(minWidth: 0, maxWidth: .infinity)
|
.frame(minWidth: 0, maxWidth: .infinity)
|
||||||
.padding(.top, 10)
|
|
||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
VStack{
|
VStack{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ struct IconView: View {
|
|||||||
)
|
)
|
||||||
|
|
||||||
Circle()
|
Circle()
|
||||||
.strokeBorder(Color.black, lineWidth: geo.size.width * 0.045)
|
.strokeBorder(customIcon.circleStrokeColor, lineWidth: geo.size.width * 0.045)
|
||||||
.background(Circle().fill(customIcon.innerColor))
|
.background(Circle().fill(customIcon.innerColor))
|
||||||
.frame(width: geo.size.width*facePercSize,
|
.frame(width: geo.size.width*facePercSize,
|
||||||
height: geo.size.height*facePercSize,
|
height: geo.size.height*facePercSize,
|
||||||
@@ -85,6 +85,7 @@ struct IconView: View {
|
|||||||
alignment: .center)
|
alignment: .center)
|
||||||
.position(x: geo.size.width*0.4,
|
.position(x: geo.size.width*0.4,
|
||||||
y: geo.size.height*0.4)
|
y: geo.size.height*0.4)
|
||||||
|
.foregroundColor(customIcon.leftEyeColor)
|
||||||
|
|
||||||
customIcon.rightEye
|
customIcon.rightEye
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -94,6 +95,7 @@ struct IconView: View {
|
|||||||
alignment: .center)
|
alignment: .center)
|
||||||
.position(x: geo.size.width*0.6,
|
.position(x: geo.size.width*0.6,
|
||||||
y: geo.size.height*0.4)
|
y: geo.size.height*0.4)
|
||||||
|
.foregroundColor(customIcon.rightEyeColor)
|
||||||
|
|
||||||
customIcon.mouth
|
customIcon.mouth
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -103,6 +105,7 @@ struct IconView: View {
|
|||||||
alignment: .center)
|
alignment: .center)
|
||||||
.position(x: geo.size.width*0.5,
|
.position(x: geo.size.width*0.5,
|
||||||
y: geo.size.height*0.59)
|
y: geo.size.height*0.59)
|
||||||
|
.foregroundColor(customIcon.mouthColor)
|
||||||
}
|
}
|
||||||
.position(x: geo.size.width/2,
|
.position(x: geo.size.width/2,
|
||||||
y: geo.size.height/2 - entireFuckingViewOffset)
|
y: geo.size.height/2 - entireFuckingViewOffset)
|
||||||
@@ -127,7 +130,11 @@ struct IconView_Previews: PreviewProvider {
|
|||||||
background: IconView_Previews.backgrounds,
|
background: IconView_Previews.backgrounds,
|
||||||
bgColor: .red,
|
bgColor: .red,
|
||||||
innerColor: .green,
|
innerColor: .green,
|
||||||
bgOverlayColor: .orange),
|
bgOverlayColor: .orange,
|
||||||
|
rightEyeColor: .orange,
|
||||||
|
leftEyeColor: .yellow,
|
||||||
|
mouthColor: .green,
|
||||||
|
circleStrokeColor: .pink),
|
||||||
isPreview: true)
|
isPreview: true)
|
||||||
.frame(width: 256, height: 256, alignment: .center)
|
.frame(width: 256, height: 256, alignment: .center)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user