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
5c1a4887
Commit
5c1a4887
authored
Aug 28, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue-7: added pink to MaterialTheme
parent
3b202f0c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
25 deletions
+43
-25
Source/AddFabButton.swift
+2
-2
Source/FabButton.swift
+1
-1
Source/MaterialTheme.swift
+39
-21
Source/RaisedButton.swift
+1
-1
No files found.
Source/AddFabButton.swift
View file @
5c1a4887
...
...
@@ -48,7 +48,7 @@ public class AddFabButton : FabButton {
//
private
func
prepareVerticalLine
()
{
verticalLine
=
UIView
(
frame
:
CGRectMake
(
0
,
0
,
lineWidth
,
CGRectGetHeight
(
backgroundColorView
.
frame
)
/
3
))
verticalLine
.
backgroundColor
=
.
whiteColor
()
verticalLine
.
backgroundColor
=
MaterialTheme
.
white
.
color
verticalLine
.
center
=
backgroundColorView
.
center
backgroundColorView
.
addSubview
(
verticalLine
)
}
...
...
@@ -58,7 +58,7 @@ public class AddFabButton : FabButton {
//
private
func
prepareHorizontalLine
()
{
horizontalLine
=
UIView
(
frame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
backgroundColorView
.
frame
)
/
3
,
lineWidth
))
horizontalLine
.
backgroundColor
=
.
whiteColor
()
horizontalLine
.
backgroundColor
=
MaterialTheme
.
white
.
color
horizontalLine
.
center
=
backgroundColorView
.
center
backgroundColorView
.
addSubview
(
horizontalLine
)
}
...
...
Source/FabButton.swift
View file @
5c1a4887
...
...
@@ -26,7 +26,7 @@ public class FabButton : MaterialButton {
super
.
prepareButton
()
prepareShadow
()
backgroundColor
=
MaterialTheme
.
red
.
darken1
pulseColor
=
MaterialTheme
.
white
.
base
pulseColor
=
MaterialTheme
.
white
.
color
backgroundColorView
.
layer
.
cornerRadius
=
bounds
.
width
/
2
}
...
...
Source/MaterialTheme.swift
View file @
5c1a4887
...
...
@@ -21,30 +21,12 @@ import UIKit
public
struct
MaterialTheme
{
// white
public
struct
white
{
public
static
let
base
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
255
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
255
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
}
// black
public
struct
black
{
public
static
let
base
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
0
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
}
// purple
public
struct
purple
{
public
static
let
lighten5
:
UIColor
=
UIColor
(
red
:
243
/
255
,
green
:
229
/
255
,
blue
:
245
/
255
,
alpha
:
1
)
public
static
let
lighten4
:
UIColor
=
UIColor
(
red
:
225
/
255
,
green
:
190
/
255
,
blue
:
231
/
255
,
alpha
:
1
)
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
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
)
public
static
let
darken4
:
UIColor
=
UIColor
(
red
:
74
/
255
,
green
:
20
/
255
,
blue
:
140
/
255
,
alpha
:
1
)
public
static
let
accent1
:
UIColor
=
UIColor
(
red
:
234
/
255
,
green
:
128
/
255
,
blue
:
252
/
255
,
alpha
:
1
)
public
static
let
accent2
:
UIColor
=
UIColor
(
red
:
224
/
255
,
green
:
64
/
255
,
blue
:
251
/
255
,
alpha
:
1
)
public
static
let
accent3
:
UIColor
=
UIColor
(
red
:
213
/
255
,
green
:
0
/
255
,
blue
:
249
/
255
,
alpha
:
1
)
public
static
let
accent4
:
UIColor
=
UIColor
(
red
:
170
/
255
,
green
:
0
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
0
/
255
,
green
:
0
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
}
// red
...
...
@@ -54,7 +36,7 @@ public struct MaterialTheme {
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
base
:
UIColor
=
UIColor
(
red
:
244
/
255
,
green
:
67
/
255
,
blue
:
54
/
255
,
alpha
:
1
)
public
static
let
color
:
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
)
...
...
@@ -64,4 +46,40 @@ public struct MaterialTheme {
public
static
let
accent3
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
23
/
255
,
blue
:
68
/
255
,
alpha
:
1
)
public
static
let
accent4
:
UIColor
=
UIColor
(
red
:
213
/
255
,
green
:
0
/
255
,
blue
:
0
/
255
,
alpha
:
1
)
}
// pink
public
struct
pink
{
public
static
let
lighten5
:
UIColor
=
UIColor
(
red
:
252
/
255
,
green
:
228
/
255
,
blue
:
236
/
255
,
alpha
:
1
)
public
static
let
lighten4
:
UIColor
=
UIColor
(
red
:
248
/
255
,
green
:
107
/
255
,
blue
:
208
/
255
,
alpha
:
1
)
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
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
)
public
static
let
darken4
:
UIColor
=
UIColor
(
red
:
136
/
255
,
green
:
14
/
255
,
blue
:
79
/
255
,
alpha
:
1
)
public
static
let
accent1
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
128
/
255
,
blue
:
171
/
255
,
alpha
:
1
)
public
static
let
accent2
:
UIColor
=
UIColor
(
red
:
255
/
255
,
green
:
64
/
255
,
blue
:
129
/
255
,
alpha
:
1
)
public
static
let
accent3
:
UIColor
=
UIColor
(
red
:
245
/
255
,
green
:
0
/
255
,
blue
:
87
/
255
,
alpha
:
1
)
public
static
let
accent4
:
UIColor
=
UIColor
(
red
:
197
/
255
,
green
:
17
/
255
,
blue
:
98
/
255
,
alpha
:
1
)
}
// purple
public
struct
purple
{
public
static
let
lighten5
:
UIColor
=
UIColor
(
red
:
243
/
255
,
green
:
229
/
255
,
blue
:
245
/
255
,
alpha
:
1
)
public
static
let
lighten4
:
UIColor
=
UIColor
(
red
:
225
/
255
,
green
:
190
/
255
,
blue
:
231
/
255
,
alpha
:
1
)
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
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
)
public
static
let
darken4
:
UIColor
=
UIColor
(
red
:
74
/
255
,
green
:
20
/
255
,
blue
:
140
/
255
,
alpha
:
1
)
public
static
let
accent1
:
UIColor
=
UIColor
(
red
:
234
/
255
,
green
:
128
/
255
,
blue
:
252
/
255
,
alpha
:
1
)
public
static
let
accent2
:
UIColor
=
UIColor
(
red
:
224
/
255
,
green
:
64
/
255
,
blue
:
251
/
255
,
alpha
:
1
)
public
static
let
accent3
:
UIColor
=
UIColor
(
red
:
213
/
255
,
green
:
0
/
255
,
blue
:
249
/
255
,
alpha
:
1
)
public
static
let
accent4
:
UIColor
=
UIColor
(
red
:
170
/
255
,
green
:
0
/
255
,
blue
:
255
/
255
,
alpha
:
1
)
}
}
Source/RaisedButton.swift
View file @
5c1a4887
...
...
@@ -26,7 +26,7 @@ public class RaisedButton : MaterialButton {
super
.
prepareButton
()
prepareShadow
()
setTitleColor
(
UIColor
.
whiteColor
(),
forState
:
.
Normal
)
pulseColor
=
MaterialTheme
.
white
.
base
pulseColor
=
MaterialTheme
.
white
.
color
backgroundColor
=
MaterialTheme
.
purple
.
darken1
backgroundColorView
.
layer
.
cornerRadius
=
3
}
...
...
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