diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index c74c3946..bbe11c36 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -34,7 +34,7 @@ open class TabBarModel: MoleculeModelProtocol { if let selectedColor = _selectedColor { return selectedColor } if let style = style, style == .dark { return Color(uiColor: VDSColor.elementsPrimaryOndark) } - return Color(uiColor: UIColor.monarchRed) + return Color(uiColor: UIColor.mvmRed) } set { _selectedColor = newValue diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 854726bb..6f994254 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -19,7 +19,7 @@ extension UIColor { /// Dictionary to access brand approved colors by name. public static let names: [String: ColorHexTuple] = ["black": (.mvmBlack, "#000000"), "white": (.mvmWhite, "#FFFFFF"), - "red": (.mvmRed, "#D52B1E"), + "red": (.mvmRed, "#F50A23"), "pink": (.mvmPink, "#D90368"), "pink33": (.mvmPink33, "#F2ABCD"), "pink66": (.mvmPink66, "#E6589B"), @@ -47,7 +47,7 @@ extension UIColor { "blueShade1": (.mvmBlueShade1, "#136598"), "blueShade2": (.mvmBlueShade2, "#0B4467"), "blueInverted": (.mvmBlueInverted, "#0088CE"), - "yellow": (.mvmYellow, "#FFBC3D"), + "yellow": (.mvmYellow, "#F5FF1E"), "coolGray1": (.mvmCoolGray1, "#F6F6F6"), "coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray6": (.mvmCoolGray6, "#747676"), @@ -55,8 +55,11 @@ extension UIColor { "upGold1": (.vzupGold1, "#F9D542"), "upGold2": (.vzupGold2, "#F4CA53"), "upGold3": (.vzupGold3, "#CC9B2D"), - "monarchRed": (.monarchRed, "#f50a23"), - "monarchStone": (.monarchStone, "#f3ede0"), + "stone": (.stone, "#F3EDE0"), + "coral": (.coral, "#FF3C2D"), + "gray44": (.gray44, "#6F7171"), + "gray85": (.gray85, "#D8DADA"), + "gray95": (.gray95, "#F6F6F6") ] //-------------------------------------------------- @@ -85,7 +88,8 @@ extension UIColor { // MARK: - Red //-------------------------------------------------- - /// HEX: #D52B1E + /// HEX: ##F50A23 + @objc public static let mvmRed = UIColor.assetColor(named: "red") //-------------------------------------------------- @@ -193,7 +197,7 @@ extension UIColor { // MARK: - Yellow //-------------------------------------------------- - /// HEX: #FFBC3D + /// HEX: ##F5FF1E public static let mvmYellow = UIColor.assetColor(named: "yellow") //-------------------------------------------------- @@ -229,11 +233,20 @@ extension UIColor { // MARK: - Monarch //-------------------------------------------------- - /// HEX: #f50a23 - @objc public static let monarchRed = UIColor.assetColor(named: "monarchRed") + /// HEX: #F3EDE0 + @objc public static let stone = UIColor.assetColor(named: "stone") + + // HEX:#FF3C2D + @objc public static let coral = UIColor.assetColor(named: "coral") - /// HEX: #f3ede0 - @objc public static let monarchStone = UIColor.assetColor(named: "monarchStone") + // HEX:#6F7171 + @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 @@ -243,6 +256,11 @@ extension UIColor { 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. public class func grayscale(rgb: Int, alpha: CGFloat = 1.0) -> UIColor { diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index cd809509..77700413 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -7,6 +7,7 @@ // #import "UIColor+MFConvenience.h" +#import @import MVMCore.MVMCoreDispatchUtility; @implementation UIColor (MFConvenience) @@ -302,8 +303,6 @@ static dispatch_once_t once; dispatch_once(&once, ^{ stringColorMapping = @{@"PrimaryRed":[UIColor mfRedColor], - @"black":[UIColor blackColor], - @"red":[UIColor mfRedColor], @"greyish":[UIColor mfLightGrayColor], @"robinsEggBlue" : [UIColor mfRobinsEggBlue], @"lightSalmon" : [UIColor mfLightSalmon], @@ -327,14 +326,9 @@ UIColor *color = nil; if (string && string.length > 0) { - color = [stringColorMapping objectForKey:string]; - if (!color){ - color = [UIColor blackColor]; - } - } else { - color = [UIColor blackColor]; + color = [stringColorMapping objectForKey:string] ?: [UIColor mvmCoreUIColorWith:string]; } - return color; + return color ?: [UIColor blackColor]; } + (nonnull UIColor *)mfGetColorForHex:(nonnull NSString *) hexString { diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json similarity index 75% rename from MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json rename to MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json index 5f3b4048..a834049e 100644 --- a/MVMCoreUI/Categories/colors.xcassets/monarchRed.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/coral.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x23", - "green" : "0x0A", - "red" : "0xF5" + "blue" : "0x2D", + "green" : "0x3C", + "red" : "0xFF" } }, "idiom" : "universal" diff --git a/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json new file mode 100644 index 00000000..296ef27c --- /dev/null +++ b/MVMCoreUI/Categories/colors.xcassets/gray44.colorset/Contents.json @@ -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 + } +} diff --git a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json index 536ccc9b..5f3b4048 100644 --- a/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/red.colorset/Contents.json @@ -1,20 +1,20 @@ { - "info" : { - "version" : 1, - "author" : "xcode" - }, "colors" : [ { - "idiom" : "universal", "color" : { "color-space" : "srgb", "components" : { - "red" : "0xD5", "alpha" : "1.000", - "blue" : "0x1E", - "green" : "0x2B" + "blue" : "0x23", + "green" : "0x0A", + "red" : "0xF5" } - } + }, + "idiom" : "universal" } - ] -} \ No newline at end of file + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json similarity index 100% rename from MVMCoreUI/Categories/colors.xcassets/monarchStone.colorset/Contents.json rename to MVMCoreUI/Categories/colors.xcassets/stone.colorset/Contents.json diff --git a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json index 5c00b5eb..5d0cb64a 100644 --- a/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/yellow.colorset/Contents.json @@ -1,20 +1,20 @@ { - "info" : { - "version" : 1, - "author" : "xcode" - }, "colors" : [ { - "idiom" : "universal", "color" : { "color-space" : "srgb", "components" : { - "red" : "0xFF", "alpha" : "1.000", - "blue" : "0x3D", - "green" : "0xBC" + "blue" : "0x1E", + "green" : "0xFF", + "red" : "0xF5" } - } + }, + "idiom" : "universal" } - ] -} \ No newline at end of file + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}