Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
61144394
Commit
61144394
authored
Sep 25, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated color naming
parent
a6ae3833
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
38 deletions
+43
-38
Source/MaterialColor.swift
+22
-28
Source/MaterialTheme.swift
+2
-2
Source/MaterialView.swift
+17
-7
Source/NavigationBarView.swift
+2
-1
No files found.
Source/MaterialColor.swift
View file @
61144394
...
...
@@ -21,19 +21,13 @@ import UIKit
// color
public
struct
MaterialColor
{
// clear
public
struct
clear
{
public
static
let
color
:
UIColor
=
UIColor
.
clearColor
()
}
public
static
let
clear
:
UIColor
=
UIColor
.
clearColor
()
// white
public
struct
white
{
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
255
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
}
public
static
let
white
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
255
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
// black
public
struct
black
{
public
static
let
color
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
0
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
}
public
static
let
black
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
0
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
// red
public
struct
red
{
...
...
@@ -42,7 +36,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
239
/
255
,
green
:
154
/
255
,
blue
:
254
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
229
/
255
,
green
:
115
/
255
,
blue
:
115
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
229
/
255
,
green
:
83
/
255
,
blue
:
80
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
244
/
255
,
green
:
67
/
255
,
blue
:
54
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
244
/
255
,
green
:
67
/
255
,
blue
:
54
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
229
/
255
,
green
:
57
/
255
,
blue
:
53
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
211
/
255
,
green
:
47
/
255
,
blue
:
47
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
198
/
255
,
green
:
40
/
255
,
blue
:
40
/
255
,
alpha
:
1
)
...
...
@@ -60,7 +54,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
244
/
255
,
green
:
143
/
255
,
blue
:
177
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
240
/
255
,
green
:
98
/
255
,
blue
:
146
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
236
/
255
,
green
:
64
/
255
,
blue
:
122
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
233
/
255
,
green
:
30
/
255
,
blue
:
99
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
233
/
255
,
green
:
30
/
255
,
blue
:
99
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
216
/
255
,
green
:
27
/
255
,
blue
:
96
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
194
/
255
,
green
:
24
/
255
,
blue
:
191
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
173
/
255
,
green
:
20
/
255
,
blue
:
87
/
255
,
alpha
:
1
)
...
...
@@ -78,7 +72,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
206
/
255
,
green
:
147
/
255
,
blue
:
216
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
186
/
255
,
green
:
104
/
255
,
blue
:
200
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
171
/
255
,
green
:
71
/
255
,
blue
:
188
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
156
/
255
,
green
:
39
/
255
,
blue
:
176
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
156
/
255
,
green
:
39
/
255
,
blue
:
176
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
142
/
255
,
green
:
36
/
255
,
blue
:
170
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
123
/
255
,
green
:
31
/
255
,
blue
:
162
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
106
/
255
,
green
:
27
/
255
,
blue
:
154
/
255
,
alpha
:
1
)
...
...
@@ -96,7 +90,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
179
/
255
,
green
:
157
/
255
,
blue
:
219
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
149
/
255
,
green
:
117
/
255
,
blue
:
205
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
126
/
255
,
green
:
87
/
255
,
blue
:
194
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
103
/
255
,
green
:
58
/
255
,
blue
:
183
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
103
/
255
,
green
:
58
/
255
,
blue
:
183
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
94
/
255
,
green
:
53
/
255
,
blue
:
177
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
81
/
255
,
green
:
45
/
255
,
blue
:
168
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
69
/
255
,
green
:
39
/
255
,
blue
:
160
/
255
,
alpha
:
1
)
...
...
@@ -114,7 +108,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
159
/
255
,
green
:
168
/
255
,
blue
:
218
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
121
/
255
,
green
:
134
/
255
,
blue
:
203
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
92
/
255
,
green
:
107
/
255
,
blue
:
192
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
63
/
255
,
green
:
81
/
255
,
blue
:
181
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
63
/
255
,
green
:
81
/
255
,
blue
:
181
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
57
/
255
,
green
:
73
/
255
,
blue
:
171
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
48
/
255
,
green
:
63
/
255
,
blue
:
159
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
40
/
255
,
green
:
53
/
255
,
blue
:
147
/
255
,
alpha
:
1
)
...
...
@@ -132,7 +126,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
144
/
255
,
green
:
202
/
255
,
blue
:
249
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
100
/
255
,
green
:
181
/
255
,
blue
:
246
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
66
/
255
,
green
:
165
/
255
,
blue
:
245
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
33
/
255
,
green
:
150
/
255
,
blue
:
243
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
33
/
255
,
green
:
150
/
255
,
blue
:
243
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
30
/
255
,
green
:
136
/
255
,
blue
:
229
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
25
/
255
,
green
:
118
/
255
,
blue
:
210
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
21
/
255
,
green
:
101
/
255
,
blue
:
192
/
255
,
alpha
:
1
)
...
...
@@ -150,7 +144,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
129
/
255
,
green
:
212
/
255
,
blue
:
250
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
79
/
255
,
green
:
195
/
255
,
blue
:
247
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
41
/
255
,
green
:
182
/
255
,
blue
:
246
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
3
/
255
,
green
:
169
/
255
,
blue
:
244
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
3
/
255
,
green
:
169
/
255
,
blue
:
244
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
3
/
255
,
green
:
155
/
255
,
blue
:
229
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
2
/
255
,
green
:
136
/
255
,
blue
:
209
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
2
/
255
,
green
:
119
/
255
,
blue
:
189
/
255
,
alpha
:
1
)
...
...
@@ -168,7 +162,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
128
/
255
,
green
:
222
/
255
,
blue
:
2343
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
77
/
255
,
green
:
208
/
255
,
blue
:
225
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
38
/
255
,
green
:
198
/
255
,
blue
:
218
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
188
/
255
,
blue
:
212
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
188
/
255
,
blue
:
212
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
172
/
255
,
blue
:
193
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
151
/
255
,
blue
:
167
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
131
/
255
,
blue
:
143
/
255
,
alpha
:
1
)
...
...
@@ -186,7 +180,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
128
/
255
,
green
:
203
/
255
,
blue
:
196
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
77
/
255
,
green
:
182
/
255
,
blue
:
172
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
38
/
255
,
green
:
166
/
255
,
blue
:
154
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
150
/
255
,
blue
:
136
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
150
/
255
,
blue
:
136
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
137
/
255
,
blue
:
123
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
121
/
255
,
blue
:
107
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
105
/
255
,
blue
:
92
/
255
,
alpha
:
1
)
...
...
@@ -204,7 +198,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
165
/
255
,
green
:
214
/
255
,
blue
:
167
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
129
/
255
,
green
:
199
/
255
,
blue
:
132
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
102
/
255
,
green
:
187
/
255
,
blue
:
106
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
76
/
255
,
green
:
175
/
255
,
blue
:
80
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
76
/
255
,
green
:
175
/
255
,
blue
:
80
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
67
/
255
,
green
:
160
/
255
,
blue
:
71
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
56
/
255
,
green
:
142
/
255
,
blue
:
60
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
46
/
255
,
green
:
125
/
255
,
blue
:
50
/
255
,
alpha
:
1
)
...
...
@@ -222,7 +216,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
197
/
255
,
green
:
225
/
255
,
blue
:
165
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
174
/
255
,
green
:
213
/
255
,
blue
:
129
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
156
/
255
,
green
:
204
/
255
,
blue
:
101
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
139
/
255
,
green
:
195
/
255
,
blue
:
74
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
139
/
255
,
green
:
195
/
255
,
blue
:
74
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
124
/
255
,
green
:
179
/
255
,
blue
:
66
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
104
/
255
,
green
:
159
/
255
,
blue
:
56
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
85
/
255
,
green
:
139
/
255
,
blue
:
47
/
255
,
alpha
:
1
)
...
...
@@ -240,7 +234,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
230
/
255
,
green
:
238
/
255
,
blue
:
156
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
220
/
255
,
green
:
231
/
255
,
blue
:
117
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
212
/
255
,
green
:
225
/
255
,
blue
:
87
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
205
/
255
,
green
:
220
/
255
,
blue
:
57
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
205
/
255
,
green
:
220
/
255
,
blue
:
57
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
192
/
255
,
green
:
202
/
255
,
blue
:
51
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
175
/
255
,
green
:
180
/
255
,
blue
:
43
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
158
/
255
,
green
:
157
/
255
,
blue
:
36
/
255
,
alpha
:
1
)
...
...
@@ -258,7 +252,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
245
/
255
,
blue
:
157
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
241
/
255
,
blue
:
118
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
238
/
255
,
blue
:
88
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
235
/
255
,
blue
:
59
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
235
/
255
,
blue
:
59
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
253
/
255
,
green
:
216
/
255
,
blue
:
53
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
251
/
255
,
green
:
192
/
255
,
blue
:
45
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
249
/
255
,
green
:
168
/
255
,
blue
:
37
/
255
,
alpha
:
1
)
...
...
@@ -276,7 +270,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
224
/
255
,
blue
:
130
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
213
/
255
,
blue
:
79
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
202
/
255
,
blue
:
40
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
193
/
255
,
blue
:
7
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
193
/
255
,
blue
:
7
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
179
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
160
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
143
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
...
...
@@ -294,7 +288,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
204
/
255
,
blue
:
128
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
183
/
255
,
blue
:
77
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
167
/
255
,
blue
:
38
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
152
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
152
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
251
/
255
,
green
:
140
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
245
/
255
,
green
:
124
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
239
/
255
,
green
:
108
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
...
...
@@ -313,7 +307,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
171
/
255
,
blue
:
145
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
138
/
255
,
blue
:
101
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
112
/
255
,
blue
:
67
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
87
/
255
,
blue
:
34
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
87
/
255
,
blue
:
34
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
244
/
255
,
green
:
81
/
255
,
blue
:
30
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
230
/
255
,
green
:
74
/
255
,
blue
:
25
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
216
/
255
,
green
:
67
/
255
,
blue
:
21
/
255
,
alpha
:
1
)
...
...
@@ -332,7 +326,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
188
/
255
,
green
:
170
/
255
,
blue
:
164
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
161
/
255
,
green
:
136
/
255
,
blue
:
127
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
141
/
255
,
green
:
110
/
255
,
blue
:
99
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
121
/
255
,
green
:
85
/
255
,
blue
:
72
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
121
/
255
,
green
:
85
/
255
,
blue
:
72
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
109
/
255
,
green
:
76
/
255
,
blue
:
65
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
93
/
255
,
green
:
64
/
255
,
blue
:
55
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
78
/
255
,
green
:
52
/
255
,
blue
:
46
/
255
,
alpha
:
1
)
...
...
@@ -346,7 +340,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
238
/
255
,
green
:
238
/
255
,
blue
:
238
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
224
/
255
,
green
:
224
/
255
,
blue
:
224
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
189
/
255
,
green
:
189
/
255
,
blue
:
189
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
158
/
255
,
green
:
158
/
255
,
blue
:
158
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
158
/
255
,
green
:
158
/
255
,
blue
:
158
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
117
/
255
,
green
:
117
/
255
,
blue
:
117
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
97
/
255
,
green
:
97
/
255
,
blue
:
97
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
66
/
255
,
green
:
66
/
255
,
blue
:
66
/
255
,
alpha
:
1
)
...
...
@@ -360,7 +354,7 @@ public struct MaterialColor {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
176
/
255
,
green
:
190
/
255
,
blue
:
197
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
144
/
255
,
green
:
164
/
255
,
blue
:
174
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
120
/
255
,
green
:
144
/
255
,
blue
:
156
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
96
/
255
,
green
:
125
/
255
,
blue
:
139
/
255
,
alpha
:
1
)
public
static
let
base
:
UIColor
=
UIColor
(
red
:
96
/
255
,
green
:
125
/
255
,
blue
:
139
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
84
/
255
,
green
:
110
/
255
,
blue
:
122
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
69
/
255
,
green
:
90
/
255
,
blue
:
100
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
55
/
255
,
green
:
71
/
255
,
blue
:
79
/
255
,
alpha
:
1
)
...
...
Source/MaterialTheme.swift
View file @
61144394
...
...
@@ -39,7 +39,7 @@ public extension MaterialTheme.view {
public
static
let
masksToBounds
:
Bool
=
false
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
white
.
color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
white
// interaction
public
static
let
userInteractionEnabled
:
Bool
=
true
...
...
@@ -67,7 +67,7 @@ public extension MaterialTheme.navigation {
public
static
let
masksToBounds
:
Bool
=
MaterialTheme
.
view
.
masksToBounds
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent
2
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent
3
public
static
let
lightContentStatusBar
:
Bool
=
true
// interaction
...
...
Source/MaterialView.swift
View file @
61144394
...
...
@@ -30,20 +30,20 @@ public class MaterialView: UIView {
}
/**
:name: contents
Gravity
:name: contents
Rect
*/
public
var
contents
Gravity
:
MaterialGravity
!
{
public
var
contents
Rect
:
CGRect
!
{
didSet
{
layer
.
contents
Gravity
=
MaterialGravityToString
(
contentsGravity
)
layer
.
contents
Rect
=
contentsRect
}
}
/**
:name: contents
Rect
:name: contents
Center
*/
public
var
contents
Rect
:
CGRect
!
{
public
var
contents
Center
:
CGRect
!
{
didSet
{
layer
.
contents
Rect
=
contentsRect
layer
.
contents
Center
=
contentsCenter
}
}
...
...
@@ -57,6 +57,15 @@ public class MaterialView: UIView {
}
/**
:name: contentsGravity
*/
public
var
contentsGravity
:
MaterialGravity
!
{
didSet
{
layer
.
contentsGravity
=
MaterialGravityToString
(
contentsGravity
)
}
}
/**
:name: backgroundColor
*/
public
override
var
backgroundColor
:
UIColor
?
{
...
...
@@ -198,9 +207,10 @@ public class MaterialView: UIView {
:name: prepareLayer
*/
internal
func
prepareLayer
()
{
contentsRect
=
MaterialTheme
.
view
.
contentsRect
contentsCenter
=
MaterialTheme
.
view
.
contentsCenter
contentsScale
=
MaterialTheme
.
view
.
contentsScale
contentsGravity
=
MaterialTheme
.
view
.
contentsGravity
contentsRect
=
MaterialTheme
.
view
.
contentsRect
shadowColor
=
MaterialTheme
.
view
.
shadowColor
shadowOffset
=
MaterialTheme
.
view
.
shadowOffset
shadowOpacity
=
MaterialTheme
.
view
.
shadowOpacity
...
...
Source/NavigationBarView.swift
View file @
61144394
...
...
@@ -51,9 +51,10 @@ public class NavigationBarView: MaterialView {
:name: prepareLayer
*/
internal
override
func
prepareLayer
()
{
contentsRect
=
MaterialTheme
.
navigation
.
contentsRect
contentsCenter
=
MaterialTheme
.
navigation
.
contentsCenter
contentsScale
=
MaterialTheme
.
navigation
.
contentsScale
contentsGravity
=
MaterialTheme
.
navigation
.
contentsGravity
contentsRect
=
MaterialTheme
.
navigation
.
contentsRect
shadowColor
=
MaterialTheme
.
navigation
.
shadowColor
shadowOffset
=
MaterialTheme
.
navigation
.
shadowOffset
shadowOpacity
=
MaterialTheme
.
navigation
.
shadowOpacity
...
...
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