Skip to content

Commit

Permalink
feat(MisticaColors): Update MisticaColors and VivoNew palette
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Refactor backgroundContainerBrand color token as MisticaColor
  • Loading branch information
alejandroruizponce authored Jul 12, 2024
1 parent 3bff3a6 commit 24a0a7c
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Sources/Mistica/Components/Lists/CellStyle+Toolkit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ extension ListCellContentView.CellStyle {
)
}

var backgroundColor: UIColor {
var backgroundColor: MisticaColor {
switch self {
case .fullWidth:
return .background
return .solid(.background)
case .boxed:
return .backgroundContainer
return .solid(.backgroundContainer)
case .boxedInverse:
return .backgroundContainerBrand
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Mistica/Components/Lists/ListCellContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ private extension ListCellContentView {
cellContentView.isLayoutMarginsRelativeArrangement = true
cellContentView.directionalLayoutMargins = cellStyle.mainStackViewLayoutMargins

cellBorderView.backgroundColor = cellStyle.backgroundColor
cellBorderView.setMisticaColorBackground(cellStyle.backgroundColor)
cellBorderView.layer.cornerRadius = cellStyle.cornerRadius
cellBorderView.layer.borderColor = cellStyle.borderColor
cellBorderView.layer.borderWidth = cellStyle.borderWidth
Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/BlauColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct BlauColors: MisticaColors {

let backgroundContainerPressed = BlauColors.palette.blauBluePrimary.withAlphaComponent(0.05) | BlauColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = BlauColors.palette.blauBluePrimary | BlauColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(BlauColors.palette.blauBluePrimary | BlauColors.palette.darkModeGrey)

let backgroundContainerBrandHover = BlauColors.palette.darkModeBlack.withAlphaComponent(0.2) | BlauColors.palette.white.withAlphaComponent(0.03)

Expand Down
4 changes: 0 additions & 4 deletions Sources/MisticaCommon/Colors/ColorToolkit+Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ public extension Color {
MisticaConfig.currentColors.backgroundContainerPressed.color
}

static var backgroundContainerBrand: Color {
MisticaConfig.currentColors.backgroundContainerBrand.color
}

static var backgroundContainerBrandHover: Color {
MisticaConfig.currentColors.backgroundContainerBrandHover.color
}
Expand Down
7 changes: 1 addition & 6 deletions Sources/MisticaCommon/Colors/ColorToolkit+UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public extension UIColor {
MisticaConfig.currentColors.backgroundContainerPressed
}

@objc(backgroundContainerBrandColor)
static var backgroundContainerBrand: UIColor {
MisticaConfig.currentColors.backgroundContainerBrand
}

@objc(backgroundContainerBrandHoverColor)
static var backgroundContainerBrandHover: UIColor {
MisticaConfig.currentColors.backgroundContainerBrandHover
Expand Down Expand Up @@ -653,7 +648,7 @@ public extension UIColor {
public extension BrandStyle {
var preferredStatusBarStyle: UIStatusBarStyle {
switch self {
case .movistar, .vivo, .o2, .o2New, .blau, .custom, .vivoNew, .telefonica, .tu:
case .movistar, .vivo, .o2, .o2New, .blau, .custom, .vivoNew, .tu, .telefonica:
return .lightContent
}
}
Expand Down
4 changes: 4 additions & 0 deletions Sources/MisticaCommon/Colors/MisticaColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ public extension MisticaColor {
static var backgroundBrand: MisticaColor {
MisticaConfig.currentColors.backgroundBrand
}

static var backgroundContainerBrand: MisticaColor {
MisticaConfig.currentColors.backgroundContainerBrand
}
}
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/MisticaColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public protocol MisticaColors {
var backgroundContainerError: UIColor { get }
var backgroundContainerHover: UIColor { get }
var backgroundContainerPressed: UIColor { get }
var backgroundContainerBrand: UIColor { get }
var backgroundContainerBrand: MisticaColor { get }
var backgroundContainerBrandHover: UIColor { get }
var backgroundContainerBrandPressed: UIColor { get }
var backgroundContainerBrandOverInverse: UIColor { get }
Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/MovistarColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct MovistarColors: MisticaColors {

let backgroundContainerPressed = MovistarColors.palette.black.withAlphaComponent(0.05) | MovistarColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = MovistarColors.palette.movistarBlue | MovistarColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(MovistarColors.palette.movistarBlue | MovistarColors.palette.darkModeGrey)

let backgroundContainerBrandHover = MovistarColors.palette.black.withAlphaComponent(0.1) | MovistarColors.palette.white.withAlphaComponent(0.03)

Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/O2ColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct O2Colors: MisticaColors {

let backgroundContainerPressed = O2Colors.palette.darkModeBlack.withAlphaComponent(0.05) | O2Colors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = O2Colors.palette.o2BluePrimary | O2Colors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(O2Colors.palette.o2BluePrimary | O2Colors.palette.darkModeGrey)

let backgroundContainerBrandHover = O2Colors.palette.darkModeBlack.withAlphaComponent(0.2) | O2Colors.palette.white.withAlphaComponent(0.03)

Expand Down
11 changes: 10 additions & 1 deletion Sources/MisticaCommon/Colors/O2NewColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ struct O2NewColors: MisticaColors {
angle: 180
))

let backgroundContainerBrand = O2NewColors.palette.beyondBlue | O2NewColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.gradient(MisticaGradient(
colors:
[
O2NewColors.palette.darkBlue | O2NewColors.palette.darkModeGrey,
O2NewColors.palette.beyondBlue | O2NewColors.palette.darkModeGrey,
O2NewColors.palette.beyondBlue45 | O2NewColors.palette.darkModeGrey
],
stops: [0, 0.64, 1],
angle: 180
))

let backgroundAlternative = O2NewColors.palette.grey20 | O2NewColors.palette.darkModeBlack

Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/TelefonicaColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct TelefonicaColors: MisticaColors {

let backgroundContainerPressed = TelefonicaColors.palette.telefonicaBlue.withAlphaComponent(0.05) | TelefonicaColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeGrey)

let backgroundContainerBrandHover = TelefonicaColors.palette.darkModeBlack.withAlphaComponent(0.2) | TelefonicaColors.palette.white.withAlphaComponent(0.03)

Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/TuColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct TuColors: MisticaColors {

let backgroundContainerPressed = TuColors.palette.grey9.withAlphaComponent(0.05) | TuColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = TuColors.palette.primary | TuColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(TuColors.palette.primary | TuColors.palette.darkModeGrey)

let backgroundContainerBrandHover = TuColors.palette.grey9.withAlphaComponent(0.2) | TuColors.palette.white.withAlphaComponent(0.03)

Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/VivoColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct VivoColors: MisticaColors {

let backgroundContainerPressed = VivoColors.palette.darkModeBlack.withAlphaComponent(0.05) | VivoColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = VivoColors.palette.vivoPurple | VivoColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(VivoColors.palette.vivoPurple | VivoColors.palette.darkModeGrey)

let backgroundContainerBrandHover = VivoColors.palette.darkModeBlack.withAlphaComponent(0.2) | VivoColors.palette.white.withAlphaComponent(0.03)

Expand Down
4 changes: 2 additions & 2 deletions Sources/MisticaCommon/Colors/VivoNewColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct VivoNewColors: MisticaColors {

let backgroundContainerPressed = VivoNewColors.palette.darkModeBlack.withAlphaComponent(0.05) | VivoNewColors.palette.white.withAlphaComponent(0.05)

let backgroundContainerBrand = VivoNewColors.palette.vivoPurple | VivoNewColors.palette.darkModeGrey
let backgroundContainerBrand = MisticaColor.solid(VivoNewColors.palette.vivoPurple | VivoNewColors.palette.darkModeGrey)

let backgroundContainerBrandHover = VivoNewColors.palette.darkModeBlack.withAlphaComponent(0.2) | VivoNewColors.palette.white.withAlphaComponent(0.03)

Expand Down Expand Up @@ -239,7 +239,7 @@ struct VivoNewColors: MisticaColors {

let textNavigationSearchBarText = VivoNewColors.palette.white | VivoNewColors.palette.grey2

let textAppBar = VivoNewColors.palette.grey4 | VivoNewColors.palette.grey5
let textAppBar = VivoNewColors.palette.grey5

let textAppBarSelected = VivoNewColors.palette.vivoPurple | VivoNewColors.palette.grey2

Expand Down

0 comments on commit 24a0a7c

Please sign in to comment.