Skip to content

Commit

Permalink
fix(Prominent): Fix prominent theme colors for Movistar (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpg93 committed Aug 1, 2022
1 parent c97e7ce commit 7c74ba6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 23 additions & 14 deletions Mistica/Source/Colors/MovistarColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ struct MovistarColors: Colors {
let appBarBackground = MovistarColorPalette.white | MovistarColorPalette.darkModeGrey
let background = MovistarColorPalette.white | MovistarColorPalette.darkModeBlack
let backgroundContainer = MovistarColorPalette.white | MovistarColorPalette.darkModeGrey
let backgroundBrand = MovistarColorPalette.movistarBlue | MovistarColorPalette.darkModeBlack
var backgroundBrand: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack }
let backgroundOverlay = MovistarColorPalette.grey6.withAlphaComponent(0.6) | MovistarColorPalette.darkModeGrey.withAlphaComponent(0.8)
let backgroundSkeleton = MovistarColorPalette.grey1 | MovistarColorPalette.grey6
let backgroundSkeletonInverse = MovistarColorPalette.movistarBlue55 | MovistarColorPalette.grey6
let navigationBarBackground = MovistarColorPalette.movistarBlue | MovistarColorPalette.darkModeBlack
var navigationBarBackground: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack }

let backgroundAlternative = MovistarColorPalette.grey1 | MovistarColorPalette.darkModeGrey // (seguramente mejor darkModeBlack)
let backgroundFeedbackBottom = MovistarColorPalette.movistarBlue | MovistarColorPalette.darkModeBlack
let backgroundAlternative = MovistarColorPalette.grey1 | MovistarColorPalette.darkModeGrey
var backgroundFeedbackBottom: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack }
let skeletonWave = MovistarColorPalette.grey2 | MovistarColorPalette.grey5

// BORDERS
Expand Down Expand Up @@ -65,24 +65,24 @@ struct MovistarColors: Colors {

// CONTROLS
let control = MovistarColorPalette.grey3 | MovistarColorPalette.grey6
let controlActivated = MovistarColorPalette.movistarBlue
var controlActivated: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant }
let controlError = MovistarColorPalette.pepper
let loadingBar = MovistarColorPalette.movistarBlue30 | MovistarColorPalette.movistarBlue
let loadingBarBackground = MovistarColorPalette.movistarBlue55 | MovistarColorPalette.darkModeGrey

// DIVIDERS
let divider = MovistarColorPalette.grey2 | MovistarColorPalette.white.withAlphaComponent(0.05)
let dividerInverse = MovistarColorPalette.movistarBlue55 | MovistarColorPalette.white.withAlphaComponent(0.05)
var navigationBarDivider = MovistarColorPalette.movistarBlue | MovistarColorPalette.darkModeBlack
var dividerInverse: UIColor { MovistarColorPalette.movistarBlue55WithProminentVariant | MovistarColorPalette.white.withAlphaComponent(0.05) }
var navigationBarDivider: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack }

// FEEDBACKS
let badge = MovistarColorPalette.pepper55
let feedbackErrorBackground = MovistarColorPalette.pepper
let feedbackInfoBackground = MovistarColorPalette.grey6

// GLOBAL
let brand = MovistarColorPalette.movistarBlue
let brandHigh = MovistarColorPalette.movistarBlue55 | MovistarColorPalette.white.withAlphaComponent(0.05)
var brand: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant }
var brandHigh: UIColor { MovistarColorPalette.movistarBlue55WithProminentVariant | MovistarColorPalette.white.withAlphaComponent(0.05) }
let inverse = MovistarColorPalette.white | MovistarColorPalette.grey2
let neutralHigh = MovistarColorPalette.grey6 | MovistarColorPalette.grey2
let neutralMedium = MovistarColorPalette.grey5
Expand All @@ -106,15 +106,15 @@ struct MovistarColors: Colors {
let textNavigationSearchBarHint = MovistarColorPalette.movistarBlue20 | MovistarColorPalette.grey4 // iOS only
let textNavigationSearchBarText = MovistarColorPalette.white | MovistarColorPalette.grey2 // iOS only
let textAppBar = MovistarColorPalette.grey4 | MovistarColorPalette.grey5
let textAppBarSelected = MovistarColorPalette.movistarBlue | MovistarColorPalette.grey2
var textAppBarSelected: UIColor { MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.grey2 }

// GRADIENTS
var backgroundBrandGradient: [UIColor] {
[
UIColor(MovistarColorPalette.movistarBlue, variants: [.prominent: MovistarColorPalette.movistarProminentBlue]) | MovistarColorPalette.darkModeBlack,
UIColor(MovistarColorPalette.movistarBlue, variants: [.prominent: MovistarColorPalette.movistarProminentBlue]) | MovistarColorPalette.darkModeBlack,
UIColor(MovistarColorPalette.movistarBlue, variants: [.prominent: MovistarColorPalette.movistarProminentBlue]) | MovistarColorPalette.darkModeBlack,
UIColor(MovistarColorPalette.movistarBlue, variants: [.prominent: MovistarColorPalette.movistarProminentBlue]) | MovistarColorPalette.darkModeBlack
MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack,
MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack,
MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack,
MovistarColorPalette.movistarBlueWithProminentVariant | MovistarColorPalette.darkModeBlack
]
}

Expand Down Expand Up @@ -181,4 +181,13 @@ public enum MovistarColorPalette {

public static let darkModeBlack = UIColor(hex: "#191919")!
public static let darkModeGrey = UIColor(hex: "#242424")!

// Prominent and default
static var movistarBlueWithProminentVariant: UIColor {
UIColor(MovistarColorPalette.movistarBlue, variants: [.prominent: MovistarColorPalette.movistarProminentBlue])
}

static var movistarBlue55WithProminentVariant: UIColor {
UIColor(MovistarColorPalette.movistarBlue55, variants: [.prominent: MovistarColorPalette.movistarProminentBlueDark])
}
}
2 changes: 1 addition & 1 deletion Mistica/Source/MisticaConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public enum MisticaConfig {

public static var themeVariant: ThemeVariant = .standard {
didSet {
NotificationCenter.default.post(name: .themeVariantDidChange, object: nil)
MisticaAppearance.setUp(controls: currentStyledControls)
NotificationCenter.default.post(name: .themeVariantDidChange, object: nil)
}
}

Expand Down

0 comments on commit 7c74ba6

Please sign in to comment.