summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2019-05-21 18:52:27 +0200
committerAndrej Mihajlov <and@mullvad.net>2019-05-22 11:35:38 +0200
commit860dbebbfe49226508765dc04072104971fa41a2 (patch)
tree1ef5f11a26ebf299f67caf2c44299add55850f81 /ios
parente4c07244f9064630133412050482308a2a34c502 (diff)
downloadmullvadvpn-860dbebbfe49226508765dc04072104971fa41a2.tar.xz
mullvadvpn-860dbebbfe49226508765dc04072104971fa41a2.zip
Scope colors into UIColor sub-structs
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/BasicTableViewCell.swift4
-rw-r--r--ios/MullvadVPN/RelayStatusIndicatorView.swift4
-rw-r--r--ios/MullvadVPN/SelectLocationCell.swift6
-rw-r--r--ios/MullvadVPN/UIColor+Palette.swift17
4 files changed, 17 insertions, 14 deletions
diff --git a/ios/MullvadVPN/BasicTableViewCell.swift b/ios/MullvadVPN/BasicTableViewCell.swift
index 288b59c4b5..88a573bb1a 100644
--- a/ios/MullvadVPN/BasicTableViewCell.swift
+++ b/ios/MullvadVPN/BasicTableViewCell.swift
@@ -14,10 +14,10 @@ class BasicTableViewCell: UITableViewCell {
super.awakeFromNib()
let backgroundView = UIView()
- backgroundView.backgroundColor = UIColor.cellBackgroundColor
+ backgroundView.backgroundColor = UIColor.Cell.backgroundColor
let selectedBackgroundView = UIView()
- selectedBackgroundView.backgroundColor = UIColor.cellSelectedBackgroundColor
+ selectedBackgroundView.backgroundColor = UIColor.Cell.selectedBackgroundColor
self.backgroundView = backgroundView
self.selectedBackgroundView = selectedBackgroundView
diff --git a/ios/MullvadVPN/RelayStatusIndicatorView.swift b/ios/MullvadVPN/RelayStatusIndicatorView.swift
index 436f4b1aac..d76fe85a3c 100644
--- a/ios/MullvadVPN/RelayStatusIndicatorView.swift
+++ b/ios/MullvadVPN/RelayStatusIndicatorView.swift
@@ -49,8 +49,8 @@ import UIKit
private func updateCircleLayerColor() {
let baseColor = isActive
- ? UIColor.relayStatusIndicatorActiveColor
- : UIColor.relayStatusIndicatorInactiveColor
+ ? UIColor.RelayStatusIndicator.activeColor
+ : UIColor.RelayStatusIndicator.inactiveColor
let circleColor = isHighlighted
? baseColor.darkened(by: 0.2) ?? baseColor
diff --git a/ios/MullvadVPN/SelectLocationCell.swift b/ios/MullvadVPN/SelectLocationCell.swift
index e7e4c82318..18adee51a8 100644
--- a/ios/MullvadVPN/SelectLocationCell.swift
+++ b/ios/MullvadVPN/SelectLocationCell.swift
@@ -91,11 +91,11 @@ class SelectLocationCell: BasicTableViewCell {
private func colorForIdentationLevel() -> UIColor {
switch indentationLevel {
case 1:
- return UIColor.subCellBackgroundColor
+ return UIColor.Cell.subCellBackgroundColor
case 2:
- return UIColor.subSubCellBackgroundColor
+ return UIColor.Cell.subSubCellBackgroundColor
default:
- return UIColor.cellBackgroundColor
+ return UIColor.Cell.backgroundColor
}
}
diff --git a/ios/MullvadVPN/UIColor+Palette.swift b/ios/MullvadVPN/UIColor+Palette.swift
index 42d6b36635..425b9fb961 100644
--- a/ios/MullvadVPN/UIColor+Palette.swift
+++ b/ios/MullvadVPN/UIColor+Palette.swift
@@ -31,13 +31,16 @@ extension UIColor {
}
// Relay availability indicator view
- static let relayStatusIndicatorActiveColor = UIColor(red: 0.27, green: 0.68, blue: 0.30, alpha: 0.9)
- static let relayStatusIndicatorInactiveColor = UIColor(red: 0.82, green: 0.01, blue: 0.11, alpha: 0.95)
+ struct RelayStatusIndicator {
+ static let activeColor = UIColor(red: 0.27, green: 0.68, blue: 0.30, alpha: 0.9)
+ static let inactiveColor = UIColor(red: 0.82, green: 0.01, blue: 0.11, alpha: 0.95)
+ }
// Cells
- static let cellBackgroundColor = UIColor(red: 0.16, green: 0.30, blue: 0.45, alpha: 1.0)
- static let subCellBackgroundColor = UIColor(red:0.15, green:0.23, blue:0.33, alpha:1.0)
- static let subSubCellBackgroundColor = UIColor(red:0.13, green:0.20, blue:0.30, alpha:1.0)
-
- static let cellSelectedBackgroundColor = UIColor(red: 0.27, green: 0.68, blue: 0.30, alpha: 1.0)
+ struct Cell {
+ static let backgroundColor = UIColor(red: 0.16, green: 0.30, blue: 0.45, alpha: 1.0)
+ static let selectedBackgroundColor = UIColor(red: 0.27, green: 0.68, blue: 0.30, alpha: 1.0)
+ static let subCellBackgroundColor = UIColor(red:0.15, green:0.23, blue:0.33, alpha:1.0)
+ static let subSubCellBackgroundColor = UIColor(red:0.13, green:0.20, blue:0.30, alpha:1.0)
+ }
}