Skip to content

Commit

Permalink
[Add] Background Color 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
YoonAh-dev committed Dec 17, 2021
1 parent 485b988 commit d1e3e3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CDSKit/Source/Catchu/CDSCatchuSelector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ extension CDSCatchuSelector where Self: UIImageView {
default:
break
}
case .empty:
self.image = CDSIcon.catchu
case .none:
break
}
Expand Down Expand Up @@ -145,8 +147,10 @@ extension CDSCatchuSelector where Self: UIImageView {
type = CDSIcon.bg700
case .yellow:
type = CDSIcon.bg800
case .none:
case .empty:
type = nil
case .none:
break
}

self.image = type
Expand Down Expand Up @@ -176,8 +180,10 @@ extension CDSCatchuSelector where Self: UIView {
colorType = CDSCatchuColor.purple.backgroundColor
case .yellow:
colorType = CDSCatchuColor.yellow.backgroundColor
case .empty:
colorType = CDSCatchuColor.none.backgroundColor
case .none:
colorType = nil
break
}

self.backgroundColor = colorType
Expand All @@ -187,6 +193,7 @@ extension CDSCatchuSelector where Self: UIView {
// MARK: - Enum

enum CatchuType: Int {
case empty = 0
case green = 1
case yellowgreen = 2
case orange = 3
Expand Down
3 changes: 3 additions & 0 deletions CDSKit/Source/Foundation/CDSCatchuColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum CDSCatchuColor {
case blue
case purple
case yellow
case none

public var backgroundColor: UIColor {
switch self {
Expand All @@ -43,6 +44,8 @@ public enum CDSCatchuColor {
return CDSColor.purplePrimaryBG
case .yellow:
return CDSColor.yellowPrimaryBG
case .none:
return CDSColor.secondaryBG
}
}

Expand Down

0 comments on commit d1e3e3d

Please sign in to comment.