Skip to content

Commit

Permalink
[Chore] #253 - added uicolor hex initializer & changed gray_500 to he…
Browse files Browse the repository at this point in the history
…x code
  • Loading branch information
seongmin221 committed May 4, 2024
1 parent 15f6d34 commit d1bb166
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
4 changes: 0 additions & 4 deletions GEON-PPANG-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
3EE1A9132AA0873500021F9D /* UrlLiteral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE1A9122AA0873500021F9D /* UrlLiteral.swift */; };
3EE343142A6440EB0010C187 /* UICollectionViewCell+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE343132A6440EB0010C187 /* UICollectionViewCell+.swift */; };
3EE466A42A69CAC6007C3C77 /* SimpleBakeryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EE466A32A69CAC6007C3C77 /* SimpleBakeryModel.swift */; };
3EF9F8902BBCEDD700F3E366 /* ColorDummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF9F88F2BBCEDD700F3E366 /* ColorDummy.swift */; };
3EF9F8922BBCEDDC00F3E366 /* ImageDummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF9F8912BBCEDDC00F3E366 /* ImageDummy.swift */; };
3EF9F8A62BBD116600F3E366 /* DummyRequestDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF9F8A52BBD116600F3E366 /* DummyRequestDTO.swift */; };
3EF9F8A82BBD116F00F3E366 /* DummyResDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF9F8A72BBD116F00F3E366 /* DummyResDTO.swift */; };
Expand Down Expand Up @@ -465,7 +464,6 @@
3EE1A9122AA0873500021F9D /* UrlLiteral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UrlLiteral.swift; sourceTree = "<group>"; };
3EE343132A6440EB0010C187 /* UICollectionViewCell+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionViewCell+.swift"; sourceTree = "<group>"; };
3EE466A32A69CAC6007C3C77 /* SimpleBakeryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleBakeryModel.swift; sourceTree = "<group>"; };
3EF9F88F2BBCEDD700F3E366 /* ColorDummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorDummy.swift; sourceTree = "<group>"; };
3EF9F8912BBCEDDC00F3E366 /* ImageDummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageDummy.swift; sourceTree = "<group>"; };
3EF9F8A52BBD116600F3E366 /* DummyRequestDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyRequestDTO.swift; sourceTree = "<group>"; };
3EF9F8A72BBD116F00F3E366 /* DummyResDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyResDTO.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1655,7 +1653,6 @@
isa = PBXGroup;
children = (
DF959A6D2A568C9400E75774 /* UIColor+.swift */,
3EF9F88F2BBCEDD700F3E366 /* ColorDummy.swift */,
);
path = Colors;
sourceTree = "<group>";
Expand Down Expand Up @@ -2101,7 +2098,6 @@
3EA69B3A2B55795B008AE23B /* SearchAPI.swift in Sources */,
0915C1752A5C533900ACB8D4 /* HomeReviewCollectionViewCell.swift in Sources */,
3E7B21C22A62172500C8F8B4 /* SortEnum.swift in Sources */,
3EF9F8902BBCEDD700F3E366 /* ColorDummy.swift in Sources */,
DF697C052A671A7B008CE4CF /* BakeryDetailCollectionViewFooter.swift in Sources */,
3EF9F8AA2BBD117400F3E366 /* DummyRepository.swift in Sources */,
097682DA2A5C829D0008F4FB /* GradientImageView.swift in Sources */,
Expand Down
10 changes: 0 additions & 10 deletions GEON-PPANG-iOS/Core/DesignSystem/Source/Colors/ColorDummy.swift

This file was deleted.

21 changes: 20 additions & 1 deletion GEON-PPANG-iOS/Core/DesignSystem/Source/Colors/UIColor+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ extension UIColor {
static let gbbGray600: UIColor = UIColor(named: "Gray_Scale/gray-600")!
static let gbbGray700: UIColor = UIColor(named: "Gray_Scale/gray-700")!
static let gbbBlack: UIColor = UIColor(named: "Gray_Scale/black")!
static let gray_500: UIColor = UIColor(named: "Gray_500")!

}

extension UIColor {
public convenience init(hex hexCode: String, alpha: CGFloat = 1.0) {
var hexFormatted: String = hexCode.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()

if hexFormatted.hasPrefix("#") {
hexFormatted = String(hexFormatted.dropFirst())
}

assert(hexFormatted.count == 6, "Invalid hex code used.")

var rgbValue: UInt64 = 0
Scanner(string: hexFormatted).scanHexInt64(&rgbValue)

self.init(red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: alpha)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ final class LogInViewController: BaseViewController {
accountLabel.do {
$0.basic(text: I18N.LogIn.noAccount,
font: .subHead!,
color: .gray_500)
color: .init(hex: "#BDBFC1"))
}

bottomSheet.do {
Expand Down

0 comments on commit d1bb166

Please sign in to comment.