Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
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
1weather
Commits
8ced8829
Commit
8ced8829
authored
Apr 08, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AirQuality: correct colors for gradients.
parent
4e428fe9
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
538 additions
and
6 deletions
+538
-6
1Weather/Model/ModelObjects/Health/Health.swift
+76
-6
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/Contents.json
+6
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/good_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/good_start.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/hazardous_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/hazardous_start.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/moderate_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/moderate_start.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_for_sensitive_groups_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_for_sensitive_groups_start.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_start.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/very_unhealthy_end.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/very_unhealthy_start.colorset/Contents.json
+38
-0
No files found.
1Weather/Model/ModelObjects/Health/Health.swift
View file @
8ced8829
...
@@ -60,17 +60,87 @@ public enum HealthStatus: String {
...
@@ -60,17 +60,87 @@ public enum HealthStatus: String {
public
var
gradientColorStart
:
UIColor
{
public
var
gradientColorStart
:
UIColor
{
get
{
get
{
#warning("Not implemented!")
switch
self
{
//TODO: Implement!
case
.
good
:
return
UIColor
.
green
guard
let
result
=
UIColor
(
named
:
"good_start"
)
else
{
assertionFailure
(
"Color not available fair quality good_startor !"
)
return
UIColor
(
red
:
33.0
/
255.0
,
green
:
238.0
/
255.0
,
blue
:
0.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
moderate
:
guard
let
result
=
UIColor
(
named
:
"moderate_start"
)
else
{
assertionFailure
(
"Color not available for air quality moderate_start!"
)
return
UIColor
(
red
:
255.0
/
255.0
,
green
:
110.0
/
255.0
,
blue
:
16.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
unhealthyForSensitiveGroups
:
guard
let
result
=
UIColor
(
named
:
"unhealthy_for_sensitive_groups_start"
)
else
{
assertionFailure
(
"Color not available for air quality unhealthy_for_sensitive_groups_start!"
)
return
UIColor
(
red
:
255.0
/
255.0
,
green
:
127.0
/
255.0
,
blue
:
0.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
unhealthy
:
guard
let
result
=
UIColor
(
named
:
"unhealthy_start"
)
else
{
assertionFailure
(
"Color not available for air quality unhealthy_start!"
)
return
UIColor
(
red
:
237.0
/
255.0
,
green
:
81.0
/
255.0
,
blue
:
81.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
veryUnhealthy
:
guard
let
result
=
UIColor
(
named
:
"very_unhealthy_start"
)
else
{
assertionFailure
(
"Color not available for air quality very_unhealthy_start!"
)
return
UIColor
(
red
:
143.0
/
255.0
,
green
:
63.0
/
255.0
,
blue
:
151.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
hazardous
:
guard
let
result
=
UIColor
(
named
:
"hazardous_start"
)
else
{
assertionFailure
(
"Color not available for air quality hazardous_start!"
)
return
UIColor
(
red
:
126.0
/
255.0
,
green
:
0.0
/
255.0
,
blue
:
34.0
/
255.0
,
alpha
:
1.0
)
}
return
result
}
}
}
}
}
public
var
gradientColorEnd
:
UIColor
{
public
var
gradientColorEnd
:
UIColor
{
get
{
get
{
#warning("Not implemented!")
switch
self
{
//TODO: Implement!
case
.
good
:
return
UIColor
.
red
guard
let
result
=
UIColor
(
named
:
"good_end"
)
else
{
assertionFailure
(
"Color not availableair quality good_end for !"
)
return
UIColor
(
red
:
8.0
/
255.0
,
green
:
207.0
/
255.0
,
blue
:
97.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
moderate
:
guard
let
result
=
UIColor
(
named
:
"moderate_end"
)
else
{
assertionFailure
(
"Color not available forair quality moderate_end !"
)
return
UIColor
(
red
:
255.0
/
255.0
,
green
:
238.0
/
255.0
,
blue
:
65.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
unhealthyForSensitiveGroups
:
guard
let
result
=
UIColor
(
named
:
"unhealthy_for_sensitive_groups_end"
)
else
{
assertionFailure
(
"Color not available for air quality unhealthy_for_sensitive_groups_end!"
)
return
UIColor
(
red
:
223.0
/
255.0
,
green
:
146.0
/
255.0
,
blue
:
70.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
unhealthy
:
guard
let
result
=
UIColor
(
named
:
"unhealthy_end"
)
else
{
assertionFailure
(
"Color not available for air quality unhealthy_end!"
)
return
UIColor
(
red
:
255.0
/
255.0
,
green
:
163.0
/
255.0
,
blue
:
163.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
veryUnhealthy
:
guard
let
result
=
UIColor
(
named
:
"very_unhealthy_end"
)
else
{
assertionFailure
(
"Color not available for air quality very_unhealthy_end!"
)
return
UIColor
(
red
:
214.0
/
255.0
,
green
:
136.0
/
255.0
,
blue
:
221.0
/
255.0
,
alpha
:
1.0
)
}
return
result
case
.
hazardous
:
guard
let
result
=
UIColor
(
named
:
"hazardous_end"
)
else
{
assertionFailure
(
"Color not available for air quality hazardous_end!"
)
return
UIColor
(
red
:
205.0
/
255.0
,
green
:
73.0
/
255.0
,
blue
:
108.0
/
255.0
,
alpha
:
1.0
)
}
return
result
}
}
}
}
}
}
}
...
...
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/Contents.json
0 → 100644
View file @
8ced8829
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/good_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"97"
,
"green"
:
"207"
,
"red"
:
"8"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.380"
,
"green"
:
"0.812"
,
"red"
:
"0.031"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/good_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0"
,
"green"
:
"238"
,
"red"
:
"33"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.000"
,
"green"
:
"0.933"
,
"red"
:
"0.129"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/hazardous_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"108"
,
"green"
:
"73"
,
"red"
:
"205"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.424"
,
"green"
:
"0.286"
,
"red"
:
"0.804"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/hazardous_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"34"
,
"green"
:
"0"
,
"red"
:
"126"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.133"
,
"green"
:
"0.000"
,
"red"
:
"0.494"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/moderate_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.255"
,
"green"
:
"0.933"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.255"
,
"green"
:
"0.933"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/moderate_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"16"
,
"green"
:
"110"
,
"red"
:
"255"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.063"
,
"green"
:
"0.431"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"163"
,
"green"
:
"163"
,
"red"
:
"255"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.639"
,
"green"
:
"0.639"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_for_sensitive_groups_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"70"
,
"green"
:
"146"
,
"red"
:
"223"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.275"
,
"green"
:
"0.573"
,
"red"
:
"0.875"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_for_sensitive_groups_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0"
,
"green"
:
"127"
,
"red"
:
"255"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.000"
,
"green"
:
"0.498"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/unhealthy_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"81"
,
"green"
:
"81"
,
"red"
:
"237"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.318"
,
"green"
:
"0.318"
,
"red"
:
"0.929"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/very_unhealthy_end.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"221"
,
"green"
:
"136"
,
"red"
:
"214"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.867"
,
"green"
:
"0.533"
,
"red"
:
"0.839"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/air_quality/very_unhealthy_start.colorset/Contents.json
0 → 100644
View file @
8ced8829
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"151"
,
"green"
:
"63"
,
"red"
:
"143"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.592"
,
"green"
:
"0.247"
,
"red"
:
"0.561"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
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