Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
28a6fb59
Commit
28a6fb59
authored
Jan 04, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统一 UIColor的写法
parent
1250b202
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
39 deletions
+31
-39
YHTabBarViewController.swift
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
+1
-1
YHHomeViewController.swift
...axy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
+1
-1
YHIntelligentServiceViewController.swift
...tService(智慧服务)/C/YHIntelligentServiceViewController.swift
+1
-1
YHLoginViewController.swift
...y/Classes/Modules/Login(登录)/C/YHLoginViewController.swift
+7
-7
YHLoginPrivacyView.swift
...laxy/Classes/Modules/Login(登录)/V/YHLoginPrivacyView.swift
+2
-2
YHLoginStyleButton.swift
...laxy/Classes/Modules/Login(登录)/V/YHLoginStyleButton.swift
+1
-1
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+2
-2
UIButton+Extension.swift
...y/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
+6
-6
UIColor+Extension.swift
...xy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
+10
-3
YhConstant.swift
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
+0
-15
No files found.
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
View file @
28a6fb59
...
@@ -38,7 +38,7 @@ extension YHTabBarViewController {
...
@@ -38,7 +38,7 @@ extension YHTabBarViewController {
//展示tabbar上的横线
//展示tabbar上的横线
func
handleTabBarLine
()
->
Void
{
func
handleTabBarLine
()
->
Void
{
let
rect
=
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
0.5
)
let
rect
=
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
0.5
)
let
fillColor
=
YHColorWithHex
(
0x888888
)
let
fillColor
=
UIColor
(
hex
:
0x888888
)
let
img
=
UIImage
.
from
(
color
:
fillColor
,
rect
:
rect
)
let
img
=
UIImage
.
from
(
color
:
fillColor
,
rect
:
rect
)
UIView
.
transition
(
with
:
self
.
tabBar
,
duration
:
0.5
,
options
:
.
transitionCrossDissolve
)
{
UIView
.
transition
(
with
:
self
.
tabBar
,
duration
:
0.5
,
options
:
.
transitionCrossDissolve
)
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
View file @
28a6fb59
...
@@ -18,7 +18,7 @@ class YHHomeViewController: YHBaseViewController {
...
@@ -18,7 +18,7 @@ class YHHomeViewController: YHBaseViewController {
func
initView
()
->
Void
{
func
initView
()
->
Void
{
navigationItem
.
title
=
"首页"
navigationItem
.
title
=
"首页"
// view.backgroundColor = YHColorWithHex(
0xE9E9E9)
view
.
backgroundColor
=
UIColor
(
hex
:
0xE9E9E9
)
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(智慧服务)/C/YHIntelligentServiceViewController.swift
View file @
28a6fb59
...
@@ -21,7 +21,7 @@ class YHIntelligentServiceViewController: YHBaseViewController {
...
@@ -21,7 +21,7 @@ class YHIntelligentServiceViewController: YHBaseViewController {
func
initView
()
{
func
initView
()
{
navigationItem
.
title
=
"智慧服务"
navigationItem
.
title
=
"智慧服务"
view
.
backgroundColor
=
YHColorWithHex
(
0xE9E9E9
)
view
.
backgroundColor
=
UIColor
(
hex
:
0xE9E9E9
)
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHLoginViewController.swift
View file @
28a6fb59
...
@@ -43,7 +43,7 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -43,7 +43,7 @@ class YHLoginViewController: YHBaseViewController {
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
text
=
"登录后更精彩"
label
.
text
=
"登录后更精彩"
label
.
font
=
kBoldFont
(
size
:
32
)
label
.
font
=
kBoldFont
(
size
:
32
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
return
label
return
label
}()
}()
view
.
addSubview
(
loginTitleLabel
)
view
.
addSubview
(
loginTitleLabel
)
...
@@ -57,7 +57,7 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -57,7 +57,7 @@ class YHLoginViewController: YHBaseViewController {
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
text
=
"香港美好生活期待与你的相遇"
label
.
text
=
"香港美好生活期待与你的相遇"
label
.
font
=
kFont
(
size
:
20
)
label
.
font
=
kFont
(
size
:
20
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
return
label
return
label
}()
}()
view
.
addSubview
(
loginSubTitleLabel
)
view
.
addSubview
(
loginSubTitleLabel
)
...
@@ -72,7 +72,7 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -72,7 +72,7 @@ class YHLoginViewController: YHBaseViewController {
label
.
text
=
"+86 133****3800"
label
.
text
=
"+86 133****3800"
label
.
font
=
kBoldFont
(
size
:
20
)
label
.
font
=
kBoldFont
(
size
:
20
)
label
.
textAlignment
=
.
center
label
.
textAlignment
=
.
center
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
return
label
return
label
}()
}()
view
.
addSubview
(
loginPhoneLabel
)
view
.
addSubview
(
loginPhoneLabel
)
...
@@ -84,11 +84,11 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -84,11 +84,11 @@ class YHLoginViewController: YHBaseViewController {
}
}
loginButton
=
{
loginButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
let
button
=
UIButton
(
type
:
.
custom
)
button
.
backgroundColor
=
YHColorWithHex
(
0x4d9ff8
)
button
.
backgroundColor
=
UIColor
(
hex
:
0x4d9ff8
)
button
.
titleLabel
?
.
font
=
kBoldFont
(
size
:
16
)
button
.
titleLabel
?
.
font
=
kBoldFont
(
size
:
16
)
button
.
contentHorizontalAlignment
=
.
center
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"本机号码一键登录"
,
for
:
.
normal
)
button
.
setTitle
(
"本机号码一键登录"
,
for
:
.
normal
)
button
.
setTitleColor
(
YHColorWithHex
(
0xffffff
),
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
layer
.
cornerRadius
=
24
button
.
layer
.
cornerRadius
=
24
return
button
return
button
}()
}()
...
@@ -101,7 +101,7 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -101,7 +101,7 @@ class YHLoginViewController: YHBaseViewController {
}
}
centerLine
=
{
centerLine
=
{
let
view
=
UIView
()
let
view
=
UIView
()
view
.
backgroundColor
=
YHColorWithHex
(
0xffffff
)
view
.
backgroundColor
=
UIColor
(
hex
:
0xffffff
)
return
view
return
view
}()
}()
view
.
addSubview
(
centerLine
)
view
.
addSubview
(
centerLine
)
...
@@ -151,7 +151,7 @@ class YHLoginViewController: YHBaseViewController {
...
@@ -151,7 +151,7 @@ class YHLoginViewController: YHBaseViewController {
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
text
=
"其他登录方式(第三方账号注册需绑定手机号)"
label
.
text
=
"其他登录方式(第三方账号注册需绑定手机号)"
label
.
font
=
kFont
(
size
:
12
)
label
.
font
=
kFont
(
size
:
12
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
label
.
textAlignment
=
.
center
label
.
textAlignment
=
.
center
return
label
return
label
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/V/YHLoginPrivacyView.swift
View file @
28a6fb59
...
@@ -43,7 +43,7 @@ class YHLoginPrivacyView: UIView {
...
@@ -43,7 +43,7 @@ class YHLoginPrivacyView: UIView {
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
text
=
"我已阅读并同意"
label
.
text
=
"我已阅读并同意"
label
.
font
=
kFont
(
size
:
12
)
label
.
font
=
kFont
(
size
:
12
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
label
.
textAlignment
=
.
left
label
.
textAlignment
=
.
left
return
label
return
label
}()
}()
...
@@ -72,7 +72,7 @@ class YHLoginPrivacyView: UIView {
...
@@ -72,7 +72,7 @@ class YHLoginPrivacyView: UIView {
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
text
=
"和"
label
.
text
=
"和"
label
.
font
=
kFont
(
size
:
12
)
label
.
font
=
kFont
(
size
:
12
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
label
.
textAlignment
=
.
left
label
.
textAlignment
=
.
left
return
label
return
label
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/V/YHLoginStyleButton.swift
View file @
28a6fb59
...
@@ -33,7 +33,7 @@ class YHLoginStyleButton: UIButton {
...
@@ -33,7 +33,7 @@ class YHLoginStyleButton: UIButton {
messageLabel
=
{
messageLabel
=
{
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
font
=
kBoldFont
(
size
:
16
)
label
.
font
=
kBoldFont
(
size
:
16
)
label
.
textColor
=
YHColorWithHex
(
0xffffff
)
label
.
textColor
=
UIColor
(
hex
:
0xffffff
)
label
.
textAlignment
=
.
right
label
.
textAlignment
=
.
right
return
label
return
label
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
28a6fb59
...
@@ -17,7 +17,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -17,7 +17,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
plain
)
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
plain
)
tableView
.
backgroundColor
=
YHColorWithHex
(
0xE9E9E9
)
tableView
.
backgroundColor
=
UIColor
(
hex
:
0xE9E9E9
)
//UIColor(hux:
0xE9E9E9)
tableView
.
separatorStyle
=
.
none
tableView
.
separatorStyle
=
.
none
tableView
.
register
(
YHPersonalCenterCell
.
self
,
forCellReuseIdentifier
:
YHPersonalCenterCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHPersonalCenterCell
.
self
,
forCellReuseIdentifier
:
YHPersonalCenterCell
.
cellReuseIdentifier
)
tableView
.
delegate
=
self
tableView
.
delegate
=
self
...
@@ -56,7 +56,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -56,7 +56,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
func
initView
()
{
func
initView
()
{
navigationItem
.
title
=
"我的"
navigationItem
.
title
=
"我的"
view
.
backgroundColor
=
YHColorWithHex
(
0xE9E9E9
)
view
.
backgroundColor
=
UIColor
(
hex
:
0xE9E9E9
)
view
.
addSubview
(
tableView
);
view
.
addSubview
(
tableView
);
...
...
galaxy/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
View file @
28a6fb59
...
@@ -85,15 +85,15 @@ extension UIButton {
...
@@ -85,15 +85,15 @@ extension UIButton {
btn
.
setTitleColor
(
lightSelectColor
,
for
:
[
.
highlighted
,
.
selected
])
btn
.
setTitleColor
(
lightSelectColor
,
for
:
[
.
highlighted
,
.
selected
])
btn
.
setBackgroundImage
(
bgNormalColor
?
.
imageWithColor
(),
for
:
.
normal
)
btn
.
setBackgroundImage
(
bgNormalColor
?
.
toImage
(),
for
:
.
normal
)
btn
.
setBackgroundImage
(
bgSelectColor
?
.
imageWithColor
(),
for
:
.
selected
)
btn
.
setBackgroundImage
(
bgSelectColor
?
.
toImage
(),
for
:
.
selected
)
btn
.
setBackgroundImage
(
bgLightNormalColor
?
.
imageWithColor
(),
for
:
[
.
highlighted
,
.
normal
])
btn
.
setBackgroundImage
(
bgLightNormalColor
?
.
toImage
(),
for
:
[
.
highlighted
,
.
normal
])
if
bgLightNormalColor
==
nil
{
if
bgLightNormalColor
==
nil
{
btn
.
setBackgroundImage
(
bgNormalColor
?
.
withAlphaComponent
(
0.9
)
.
imageWithColor
(),
for
:
[
.
highlighted
,
.
normal
])
btn
.
setBackgroundImage
(
bgNormalColor
?
.
withAlphaComponent
(
0.9
)
.
toImage
(),
for
:
[
.
highlighted
,
.
normal
])
}
}
btn
.
setBackgroundImage
(
bgLightSelectColor
?
.
imageWithColor
(),
for
:
[
.
highlighted
,
.
selected
])
btn
.
setBackgroundImage
(
bgLightSelectColor
?
.
toImage
(),
for
:
[
.
highlighted
,
.
selected
])
if
bgLightSelectColor
==
nil
{
if
bgLightSelectColor
==
nil
{
btn
.
setBackgroundImage
(
bgSelectColor
?
.
withAlphaComponent
(
0.9
)
.
imageWithColor
(),
for
:
[
.
highlighted
,
.
selected
])
btn
.
setBackgroundImage
(
bgSelectColor
?
.
withAlphaComponent
(
0.9
)
.
toImage
(),
for
:
[
.
highlighted
,
.
selected
])
}
}
return
btn
return
btn
...
...
galaxy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
View file @
28a6fb59
...
@@ -33,11 +33,18 @@ extension UIColor {
...
@@ -33,11 +33,18 @@ extension UIColor {
static
let
black50Persent
:
UIColor
=
UIColor
.
black
.
withAlphaComponent
(
0.5
)
static
let
black50Persent
:
UIColor
=
UIColor
.
black
.
withAlphaComponent
(
0.5
)
public
convenience
init
(
r
:
CGFloat
,
g
:
CGFloat
,
b
:
CGFloat
)
{
public
convenience
init
(
r
:
CGFloat
,
g
:
CGFloat
,
b
:
CGFloat
,
alpha
:
CGFloat
=
1.0
)
{
self
.
init
(
red
:
r
/
255.0
,
green
:
g
/
255.0
,
blue
:
b
/
255.0
,
alpha
:
1.0
)
self
.
init
(
red
:
r
/
255.0
,
green
:
g
/
255.0
,
blue
:
b
/
255.0
,
alpha
:
alpha
)
}
}
public
func
imageWithColor
(
width
:
Double
=
1.0
,
height
:
Double
=
1.0
)
->
UIImage
{
// 根据色值生成颜色(无透明度)(格式为0xffffff)
public
convenience
init
(
hex
:
NSInteger
,
alpha
:
CGFloat
=
1.0
)
{
self
.
init
(
red
:
((
CGFloat
)((
hex
&
0xFF0000
)
>>
16
))
/
255.0
,
green
:
((
CGFloat
)((
hex
&
0xFF00
)
>>
8
))
/
255.0
,
blue
:
((
CGFloat
)(
hex
&
0xFF
))
/
255.0
,
alpha
:
alpha
)
}
//生成 对应色值的图片
public
func
toImage
(
width
:
Double
=
1.0
,
height
:
Double
=
1.0
)
->
UIImage
{
let
rect
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
width
,
height
:
height
)
let
rect
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
width
,
height
:
height
)
UIGraphicsBeginImageContext
(
rect
.
size
)
UIGraphicsBeginImageContext
(
rect
.
size
)
let
ctx
=
UIGraphicsGetCurrentContext
()
let
ctx
=
UIGraphicsGetCurrentContext
()
...
...
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
View file @
28a6fb59
...
@@ -134,21 +134,6 @@ func isIphoneX() -> Bool {
...
@@ -134,21 +134,6 @@ func isIphoneX() -> Bool {
return
k_Height_safeAreaInsetsBottom
()
>
0.0
// 底部安全区 > 0 时,
return
k_Height_safeAreaInsetsBottom
()
>
0.0
// 底部安全区 > 0 时,
}
}
/// 根据RGBA生成颜色(格式为:22,22,22,0.5)
var
YHRGBAColor
:
(
CGFloat
,
CGFloat
,
CGFloat
,
CGFloat
)
->
UIColor
=
{
red
,
green
,
blue
,
alpha
in
return
UIColor
(
red
:
red
/
255
,
green
:
green
/
255
,
blue
:
blue
/
255
,
alpha
:
alpha
)
}
/// 根据RGB生成颜色(格式为:22,22,22)
var
YHRGBColor
:
(
CGFloat
,
CGFloat
,
CGFloat
)
->
UIColor
=
{
red
,
green
,
blue
in
return
UIColor
(
red
:
red
/
255
,
green
:
green
/
255
,
blue
:
blue
/
255
,
alpha
:
1
)
}
/// 根据色值生成颜色(无透明度)(格式为0xffffff)
var
YHColorWithHex
:
(
NSInteger
)
->
UIColor
=
{
hex
in
return
UIColor
(
red
:
((
CGFloat
)((
hex
&
0xFF0000
)
>>
16
))
/
255.0
,
green
:
((
CGFloat
)((
hex
&
0xFF00
)
>>
8
))
/
255.0
,
blue
:
((
CGFloat
)(
hex
&
0xFF
))
/
255.0
,
alpha
:
1
)
}
class
YhConstant
{
class
YhConstant
{
// MARK: - URL 相关
// MARK: - URL 相关
struct
URL
{
struct
URL
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment