Skip to content
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

Merged
merged 3 commits into from
Oct 17, 2022
Merged

Conversation

RuyHa
Copy link
Collaborator

@RuyHa RuyHa commented Oct 17, 2022

Motivation

  • [Feat] - Style, Font Extension #6
    1. 커스텀 컬러들을 시스템 컬러처럼 사용 가능하게 커스텀 하였습니다.
    1. EZPZGradient 를 만들었습니다.
    1. 폰트, 사이즈, 색 까지 한번에 저장된 값을 사용 가능합니다.

Key Change

기존 EZPZ와 다르게 몇가지 변경 사항이 있습니다.

  1. 커스텀 컬러들을 시스템 컬러처럼 사용 가능하게 커스텀 하였습니다.

아래의 코드 처럼 편하게 쓰시면됩니다.

  Color.ezpzBlack
  Color.ezpzLime
  1. EZPZGradient 를 만들었습니다.
    더이상 긴 코드를 작성하지 않아도 됩니다.
Color.red
     .EZPZGradient(startPoint: .top, endPoint: .bottom)

Color.red
    .EZPZGradient(startPoint: .leading, endPoint: .trailing)

  1. 폰트, 사이즈, 색 까지 한번에 저장된 값을 사용 가능합니다.
    폰트에는 색상을 추가 할 수 없으나 린다가 만들어 주신 파일에 색상 까지 명시 되어 있어서
    작업해 봤습니다.
    해당 코드는 코드 리뷰로 남겨 놓겠습니다.

스크린샷 2022-10-17 오후 7 41 09

To Reviewers

폰트의 경우 스케치에 있는 이름 그대로 작성 했는데 앞에 ezpz를 붙이는게 찾기 편할지
아니면 그냥 지금처럼 쓸지 고민해봐야 할듯 합니다...

RuyHa added 3 commits October 16, 2022 03:01
1. 컬러값 추가 및 Color extension 처리 완료
2. gradient 커스텀 및 View extension 처리 완료
3. Text에 한줄로 색상 및 폰트 까지 적용 가능하도록 작업 및 Text extension 작업중
@RuyHa RuyHa added the enhancement New feature or request label Oct 17, 2022
@RuyHa RuyHa self-assigned this Oct 17, 2022
Copy link
Collaborator Author

@RuyHa RuyHa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이상 입니다.

Comment on lines +12 to +30
// 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")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이러한 방식으로 등록을 해 놓으면 시스템 컬러 값 처럼 사용이 가능합니다.

Comment on lines +11 to +14
func basicTitle1() -> Text {
self.font(Font.custom("SpoqaHanSans-Bold", size: 34))
.foregroundColor(.grayScale1)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 코드를 뜯어 봤을때 대부분 문자열은 Text안에 들어 있어 이렇게 커스텀을 해놨습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setBasicTitle1로 수정해서 함수임을 부각하는 네이밍은 어떨까요 ?!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

예니 말에 동의해요. 조금 더 함수스러운 네이밍이면 좋을듯 합니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 생각인것 같아요. 저도 조금 더 통일성 있는 이름으로 만들고 싶었으나
혼자 정하면 안될것 같았어요.

Comment on lines +11 to +16
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View {
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]),
startPoint: startPoint,
endPoint: endPoint))
.mask(self)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기본 LinearGradient를 사용 하는 것 보다 커스텀 하여 사용하는 것이 효율적이라고 판단해 이렇게 만들었습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradient가 필요할 때마다 길게 코드를 작성할 수고를 덜게 되었네요! 감사합니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 좋아요 :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!

@Hongjaaa
Copy link
Collaborator

코드 잘 읽었습니다!
Custom Color, EZPZ Gradient, 그리고 폰트 설정까지 사용하기 정말 편하게 만들어주셔서 감사합니다.
디자인 스타일 가이드의 Typo 명칭과 동일하게 폰트를 커스텀 해주셔서 사용하는 동안 정말 편할 것 같습니다!

Comment on lines +11 to +16
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View {
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]),
startPoint: startPoint,
endPoint: endPoint))
.mask(self)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradient가 필요할 때마다 길게 코드를 작성할 수고를 덜게 되었네요! 감사합니다!

Copy link
Collaborator

@yeniful yeniful left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ETC인가용 ?-?

Comment on lines +11 to +14
func basicTitle1() -> Text {
self.font(Font.custom("SpoqaHanSans-Bold", size: 34))
.foregroundColor(.grayScale1)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setBasicTitle1로 수정해서 함수임을 부각하는 네이밍은 어떨까요 ?!

Comment on lines +11 to +16
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View {
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]),
startPoint: startPoint,
endPoint: endPoint))
.mask(self)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 좋아요 :D

Copy link
Member

@Juhwa-Lee1023 Juhwa-Lee1023 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하나하나 Extension으로 정리해주셔서 작업하기 훨신 편해질 것 같아요 ㅎㅎ 감사합니다!

Comment on lines +11 to +16
public func EZPZGradient(startPoint: UnitPoint, endPoint: UnitPoint) -> some View {
self.overlay(LinearGradient(gradient: .init(colors: [.ezpzLime,.ezpzPink]),
startPoint: startPoint,
endPoint: endPoint))
.mask(self)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!

@Juhwa-Lee1023 Juhwa-Lee1023 merged commit a8e30e3 into EZPZapp:main Oct 17, 2022
@RuyHa RuyHa deleted the Setting branch October 18, 2022 05:38
@RuyHa
Copy link
Collaborator Author

RuyHa commented Oct 18, 2022

근데...이거 메인에 머지한거 같은데...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants