-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] Style, Font Extension #6 #12
Conversation
1. 컬러값 추가 및 Color extension 처리 완료 2. gradient 커스텀 및 View extension 처리 완료 3. Text에 한줄로 색상 및 폰트 까지 적용 가능하도록 작업 및 Text extension 작업중
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이상 입니다.
// MAIN COLOR | ||
static let ezpzPink = Color("EZPZPink") | ||
static let ezpzLime = Color("EZPZLime") | ||
|
||
// GRAY COLOR | ||
static let grayScale1 = Color("Grayscale1") | ||
static let grayScale2 = Color("Grayscale2") | ||
static let grayScale3 = Color("Grayscale3") | ||
static let grayScale4 = Color("Grayscale4") | ||
static let grayScale5 = Color("Grayscale5") | ||
static let ezpzBlack = Color("EZPZBlack") | ||
|
||
// ECT | ||
static let cardPink = Color("CardPink") | ||
static let cardPurple = Color("CardPurple") | ||
static let cardOatmeal = Color("CardOatmeal") | ||
static let cardGreen = Color("CardGreen") | ||
static let cardSkyblue = Color("CardSkyblue") | ||
static let cardblue = Color("Cardblue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이러한 방식으로 등록을 해 놓으면 시스템 컬러 값 처럼 사용이 가능합니다.
func basicTitle1() -> Text { | ||
self.font(Font.custom("SpoqaHanSans-Bold", size: 34)) | ||
.foregroundColor(.grayScale1) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존 코드를 뜯어 봤을때 대부분 문자열은 Text안에 들어 있어 이렇게 커스텀을 해놨습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setBasicTitle1로 수정해서 함수임을 부각하는 네이밍은 어떨까요 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예니 말에 동의해요. 조금 더 함수스러운 네이밍이면 좋을듯 합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 생각인것 같아요. 저도 조금 더 통일성 있는 이름으로 만들고 싶었으나
혼자 정하면 안될것 같았어요.
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View { | ||
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]), | ||
startPoint: startPoint, | ||
endPoint: endPoint)) | ||
.mask(self) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본 LinearGradient를 사용 하는 것 보다 커스텀 하여 사용하는 것이 효율적이라고 판단해 이렇게 만들었습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradient가 필요할 때마다 길게 코드를 작성할 수고를 덜게 되었네요! 감사합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 좋아요 :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!!
코드 잘 읽었습니다! |
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View { | ||
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]), | ||
startPoint: startPoint, | ||
endPoint: endPoint)) | ||
.mask(self) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradient가 필요할 때마다 길게 코드를 작성할 수고를 덜게 되었네요! 감사합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style 코드 만들어주시느라 고생하셨습니다 류하!
static let grayScale5 = Color("Grayscale5") | ||
static let ezpzBlack = Color("EZPZBlack") | ||
|
||
// ECT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ETC인가용 ?-?
func basicTitle1() -> Text { | ||
self.font(Font.custom("SpoqaHanSans-Bold", size: 34)) | ||
.foregroundColor(.grayScale1) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setBasicTitle1로 수정해서 함수임을 부각하는 네이밍은 어떨까요 ?!
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View { | ||
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]), | ||
startPoint: startPoint, | ||
endPoint: endPoint)) | ||
.mask(self) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 좋아요 :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 하나하나 Extension으로 정리해주셔서 작업하기 훨신 편해질 것 같아요 ㅎㅎ 감사합니다!
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View { | ||
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]), | ||
startPoint: startPoint, | ||
endPoint: endPoint)) | ||
.mask(self) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!!
근데...이거 메인에 머지한거 같은데... |
Motivation
Key Change
기존 EZPZ와 다르게 몇가지 변경 사항이 있습니다.
아래의 코드 처럼 편하게 쓰시면됩니다.
더이상 긴 코드를 작성하지 않아도 됩니다.
폰트에는 색상을 추가 할 수 없으나 린다가 만들어 주신 파일에 색상 까지 명시 되어 있어서
작업해 봤습니다.
해당 코드는 코드 리뷰로 남겨 놓겠습니다.
To Reviewers
폰트의 경우 스케치에 있는 이름 그대로 작성 했는데 앞에 ezpz를 붙이는게 찾기 편할지
아니면 그냥 지금처럼 쓸지 고민해봐야 할듯 합니다...