-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/#15-on-view
- Loading branch information
Showing
13 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// Ext + UIColor.swift | ||
// On_off_iOS | ||
// | ||
// Created by 신예진 on 1/30/24. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
extension UIColor { | ||
convenience init(hex: String) { | ||
let scanner = Scanner(string: hex) | ||
_ = scanner.scanString("#") | ||
|
||
var rgb: UInt64 = 0 | ||
scanner.scanHexInt64(&rgb) | ||
|
||
let r = CGFloat((rgb >> 16) & 0xFF) / 255.0 | ||
let g = CGFloat((rgb >> 8) & 0xFF) / 255.0 | ||
let b = CGFloat((rgb >> 0) & 0xFF) / 255.0 | ||
self.init(red: r, green: g, blue: b, alpha: 1.0) | ||
} | ||
|
||
static func colorFromString(_ string: String) -> UIColor { | ||
switch string.uppercased() { | ||
case "YELLOW": | ||
return UIColor.OnOffYellow | ||
case "PURPLE": | ||
return UIColor.OnOffPurple | ||
case "BLACK": | ||
return UIColor.black | ||
case "WHITE": | ||
return UIColor.white | ||
default: | ||
return .clear | ||
} | ||
} | ||
} | ||
|
||
extension UIColor { | ||
static let OnOffMain = UIColor(hex: "7D4BFF") // OnOff 메인컬러 | ||
static let OnOffYellow = UIColor(hex: "#FFD572") //StatisticsView 그래프 컬러 | ||
static let OnOffPurple = UIColor(hex: "#7D4BFF") | ||
static var OnOffLightPurple: UIColor { //날짜 선택 안되었을 때의 컬러 | ||
return OnOffPurple.withAlphaComponent(0.3) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Ext + Font.swift | ||
// On_off_iOS | ||
// | ||
// Created by 신예진 on 1/30/24. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
extension UIFont { | ||
static func pretendard(size fontSize: CGFloat, weight: UIFont.Weight) -> UIFont { | ||
let familyName = "Pretendard" | ||
|
||
var weightString: String | ||
switch weight { | ||
case .black: | ||
weightString = "Black" | ||
case .bold: | ||
weightString = "Blod" | ||
case .heavy: | ||
weightString = "ExtraBold" | ||
case .ultraLight: | ||
weightString = "ExtraLight" | ||
case .light: | ||
weightString = "Light" | ||
case .medium: | ||
weightString = "Medium" | ||
case .regular: | ||
weightString = "Regular" | ||
case .semibold: | ||
weightString = "SemiBold" | ||
case .thin: | ||
weightString = "Thin" | ||
default: | ||
weightString = "Regular" | ||
} | ||
|
||
return UIFont(name: "\(familyName)-\(weightString)", size: fontSize) ?? .systemFont(ofSize: fontSize, weight: weight) | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters