Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Prominent): Fix prominent theme colors for Movistar #199

Merged
merged 9 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions Mistica/Source/Colors/MovistarColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ struct MovistarColors: Colors {
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 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use computed properties. Otherwise, the prominent color will be wrong.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we state some kind of premises so other will have this problem into account in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked offline. The best option for this to not happen again is to create tests for prominent. I've create this ticket to https://jira.tid.es/browse/IOS-7587 tackle it down at some point.


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,12 @@ 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