Skip to content

Commit f8089da

Browse files
0Hoonihsw1920
andcommitted
feat/#176 :: 유저 컬러 추가
Co-Authored-By: seuhong <[email protected]>
1 parent d8ec12f commit f8089da

File tree

2 files changed

+20
-1
lines changed
  • PhotoGether
    • DomainLayer/PhotoGetherDomain/PhotoGetherDomainInterface/Entity
    • PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/View

2 files changed

+20
-1
lines changed

PhotoGether/DomainLayer/PhotoGetherDomain/PhotoGetherDomainInterface/Entity/UserInfo.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ public struct UserInfo: Identifiable, Equatable, Codable {
1616
case bottomTrailing
1717
case topTrailing
1818
case bottomLeading
19+
20+
public var color: UserColor {
21+
switch self {
22+
case .topLeading: return .orange
23+
case .bottomTrailing: return .brown
24+
case .topTrailing: return .blue
25+
case .bottomLeading: return .gray
26+
}
27+
}
1928
}
2029

2130
public init(
@@ -31,4 +40,11 @@ public struct UserInfo: Identifiable, Equatable, Codable {
3140
self.viewPosition = viewPosition
3241
self.roomID = roomID
3342
}
43+
44+
public enum UserColor: String, Codable {
45+
case orange = "#FF7561"
46+
case brown = "#E7C892"
47+
case blue = "#82BBE6"
48+
case gray = "#7D7C84"
49+
}
3450
}

PhotoGether/PresentationLayer/EditPhotoRoomFeature/EditPhotoRoomFeature/Source/View/StickerView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,11 @@ final class StickerView: UIView {
206206

207207
if owner == user {
208208
layerView.layer.borderColor = PTGColor.primaryGreen.color.cgColor
209+
nicknameLabel.backgroundColor = PTGColor.primaryGreen.color
209210
} else {
210-
layerView.layer.borderColor = PTGColor.gray70.color.cgColor
211+
guard let hexColor = owner?.viewPosition.color.rawValue else { return }
212+
layerView.layer.borderColor = UIColor(hex: hexColor).cgColor
213+
nicknameLabel.backgroundColor = UIColor(hex: hexColor)
211214
}
212215
}
213216

0 commit comments

Comments
 (0)