Digital ACT191 story ONV9720_MVAPP - Updated colors and icons for Monarch MVP

This commit is contained in:
Scott Pfeil 2024-04-24 11:37:31 -04:00
parent b8526ac8e1
commit 01371a320a
8 changed files with 77 additions and 45 deletions

View File

@ -34,7 +34,7 @@ open class TabBarModel: MoleculeModelProtocol {
if let selectedColor = _selectedColor { return selectedColor } if let selectedColor = _selectedColor { return selectedColor }
if let style = style, if let style = style,
style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) } style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) }
return Color(uiColor: UIColor.monarchRed) return Color(uiColor: UIColor.mvmRed)
} }
set { set {
_selectedColor = newValue _selectedColor = newValue

View File

@ -19,7 +19,7 @@ extension UIColor {
/// Dictionary to access brand approved colors by name. /// Dictionary to access brand approved colors by name.
public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"),
"white": (.mvmWhite, "#FFFFFF"), "white": (.mvmWhite, "#FFFFFF"),
"red": (.mvmRed, "#D52B1E"), "red": (.mvmRed, "#F50A23"),
"pink": (.mvmPink, "#D90368"), "pink": (.mvmPink, "#D90368"),
"pink33": (.mvmPink33, "#F2ABCD"), "pink33": (.mvmPink33, "#F2ABCD"),
"pink66": (.mvmPink66, "#E6589B"), "pink66": (.mvmPink66, "#E6589B"),
@ -47,7 +47,7 @@ extension UIColor {
"blueShade1": (.mvmBlueShade1, "#136598"), "blueShade1": (.mvmBlueShade1, "#136598"),
"blueShade2": (.mvmBlueShade2, "#0B4467"), "blueShade2": (.mvmBlueShade2, "#0B4467"),
"blueInverted": (.mvmBlueInverted, "#0088CE"), "blueInverted": (.mvmBlueInverted, "#0088CE"),
"yellow": (.mvmYellow, "#FFBC3D"), "yellow": (.mvmYellow, "#F5FF1E"),
"coolGray1": (.mvmCoolGray1, "#F6F6F6"), "coolGray1": (.mvmCoolGray1, "#F6F6F6"),
"coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray3": (.mvmCoolGray3, "#D8DADA"),
"coolGray6": (.mvmCoolGray6, "#747676"), "coolGray6": (.mvmCoolGray6, "#747676"),
@ -55,8 +55,11 @@ extension UIColor {
"upGold1": (.vzupGold1, "#F9D542"), "upGold1": (.vzupGold1, "#F9D542"),
"upGold2": (.vzupGold2, "#F4CA53"), "upGold2": (.vzupGold2, "#F4CA53"),
"upGold3": (.vzupGold3, "#CC9B2D"), "upGold3": (.vzupGold3, "#CC9B2D"),
"monarchRed": (.monarchRed, "#f50a23"), "stone": (.stone, "#F3EDE0"),
"monarchStone": (.monarchStone, "#f3ede0"), "coral": (.coral, "#FF3C2D"),
"gray44": (.gray44, "#6F7171"),
"gray85": (.gray85, "#D8DADA"),
"gray95": (.gray95, "#F6F6F6")
] ]
//-------------------------------------------------- //--------------------------------------------------
@ -85,7 +88,8 @@ extension UIColor {
// MARK: - Red // MARK: - Red
//-------------------------------------------------- //--------------------------------------------------
/// HEX: #D52B1E /// HEX: ##F50A23
@objc
public static let mvmRed = UIColor.assetColor(named: "red") public static let mvmRed = UIColor.assetColor(named: "red")
//-------------------------------------------------- //--------------------------------------------------
@ -193,7 +197,7 @@ extension UIColor {
// MARK: - Yellow // MARK: - Yellow
//-------------------------------------------------- //--------------------------------------------------
/// HEX: #FFBC3D /// HEX: ##F5FF1E
public static let mvmYellow = UIColor.assetColor(named: "yellow") public static let mvmYellow = UIColor.assetColor(named: "yellow")
//-------------------------------------------------- //--------------------------------------------------
@ -229,11 +233,20 @@ extension UIColor {
// MARK: - Monarch // MARK: - Monarch
//-------------------------------------------------- //--------------------------------------------------
/// HEX: #f50a23 /// HEX: #F3EDE0
@objc public static let monarchRed = UIColor.assetColor(named: "monarchRed") @objc public static let stone = UIColor.assetColor(named: "stone")
// HEX:#FF3C2D
@objc public static let coral = UIColor.assetColor(named: "coral")
/// HEX: #f3ede0 // HEX:#6F7171
@objc public static let monarchStone = UIColor.assetColor(named: "monarchStone") @objc public static let gray44 = UIColor.assetColor(named: "gray44")
// HEX:#D8DADA
@objc public static let gray85 = mvmCoolGray3
// HEX:#F6F6F6
@objc public static let gray95 = mvmCoolGray1
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Functions // MARK: - Functions
@ -243,6 +256,11 @@ extension UIColor {
return UIColor(named: name, in: MVMCoreUIUtility.bundleForMVMCoreUI(), compatibleWith: nil)! return UIColor(named: name, in: MVMCoreUIUtility.bundleForMVMCoreUI(), compatibleWith: nil)!
} }
@objc
public static func mvmCoreUIColor(with name: String) -> UIColor? {
return UIColor.names[name]?.uiColor
}
/// Convenience to get a grayscale UIColor where the same value is used for red, green, and blue. /// Convenience to get a grayscale UIColor where the same value is used for red, green, and blue.
public class func grayscale(rgb: Int, alpha: CGFloat = 1.0) -> UIColor { public class func grayscale(rgb: Int, alpha: CGFloat = 1.0) -> UIColor {

View File

@ -7,6 +7,7 @@
// //
#import "UIColor+MFConvenience.h" #import "UIColor+MFConvenience.h"
#import <MVMCoreUI/MVMCoreUI-Swift.h>
@import MVMCore.MVMCoreDispatchUtility; @import MVMCore.MVMCoreDispatchUtility;
@implementation UIColor (MFConvenience) @implementation UIColor (MFConvenience)
@ -302,8 +303,6 @@
static dispatch_once_t once; static dispatch_once_t once;
dispatch_once(&once, ^{ dispatch_once(&once, ^{
stringColorMapping = @{@"PrimaryRed":[UIColor mfRedColor], stringColorMapping = @{@"PrimaryRed":[UIColor mfRedColor],
@"black":[UIColor blackColor],
@"red":[UIColor mfRedColor],
@"greyish":[UIColor mfLightGrayColor], @"greyish":[UIColor mfLightGrayColor],
@"robinsEggBlue" : [UIColor mfRobinsEggBlue], @"robinsEggBlue" : [UIColor mfRobinsEggBlue],
@"lightSalmon" : [UIColor mfLightSalmon], @"lightSalmon" : [UIColor mfLightSalmon],
@ -327,14 +326,9 @@
UIColor *color = nil; UIColor *color = nil;
if (string && string.length > 0) { if (string && string.length > 0) {
color = [stringColorMapping objectForKey:string]; color = [stringColorMapping objectForKey:string] ?: [UIColor mvmCoreUIColorWith:string];
if (!color){
color = [UIColor blackColor];
}
} else {
color = [UIColor blackColor];
} }
return color; return color ?: [UIColor blackColor];
} }
+ (nonnull UIColor *)mfGetColorForHex:(nonnull NSString *) hexString { + (nonnull UIColor *)mfGetColorForHex:(nonnull NSString *) hexString {

View File

@ -5,9 +5,9 @@
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0x23", "blue" : "0x2D",
"green" : "0x0A", "green" : "0x3C",
"red" : "0xF5" "red" : "0xFF"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

View File

@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x71",
"green" : "0x71",
"red" : "0x6F"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,20 +1,20 @@
{ {
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [ "colors" : [
{ {
"idiom" : "universal",
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"red" : "0xD5",
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0x1E", "blue" : "0x23",
"green" : "0x2B" "green" : "0x0A",
"red" : "0xF5"
} }
} },
"idiom" : "universal"
} }
] ],
} "info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,20 +1,20 @@
{ {
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [ "colors" : [
{ {
"idiom" : "universal",
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"red" : "0xFF",
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0x3D", "blue" : "0x1E",
"green" : "0xBC" "green" : "0xFF",
"red" : "0xF5"
} }
} },
"idiom" : "universal"
} }
] ],
} "info" : {
"author" : "xcode",
"version" : 1
}
}