diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift index 8e528deb..553b36d2 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/Link/Link.swift @@ -28,8 +28,8 @@ import UIKit // x should be according to the text, not the button let x = textRect.origin.x - // Line is 1 point below the text - let y = textRect.origin.y + textRect.size.height + 1 + // Line is 0 point below the text + let y = textRect.origin.y + textRect.size.height + 0 context.move(to: CGPoint(x: x, y: y)) context.addLine(to: CGPoint(x: x + textRect.size.width, y: y)) @@ -56,6 +56,7 @@ import UIKit } setTitleColor((model.inverted ? model.enabledColor_inverted : model.enabledColor).uiColor, for: .normal) setTitleColor((model.inverted ? model.disabledColor_inverted : model.disabledColor).uiColor, for: .disabled) + setTitleColor((model.inverted ? model.activeColor_inverted : model.activeColor).uiColor, for: .highlighted) isEnabled = model.enabled set(with: model.action, delegateObject: delegateObject, additionalData: additionalData) } @@ -82,7 +83,7 @@ extension Link { backgroundColor = .clear contentMode = .redraw setTitleColor(.mvmBlack, for: .normal) - setTitleColor(.mvmCoolGray6, for: .disabled) + setTitleColor(.mvmCoolGray3, for: .disabled) titleLabel?.numberOfLines = 1 titleLabel?.lineBreakMode = .byTruncatingTail titleLabel?.textAlignment = .left diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift index 955601ac..adfce57c 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/Link/LinkModel.swift @@ -24,8 +24,11 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode public var enabled = true public var enabledColor = Color(uiColor: .mvmBlack) public var enabledColor_inverted = Color(uiColor: .mvmWhite) - public var disabledColor = Color(uiColor: .mvmCoolGray6) + public var disabledColor = Color(uiColor: .mvmCoolGray3) public var disabledColor_inverted = Color(uiColor: .mvmCoolGray10) + public var activeColor = Color(uiColor: .mvmGray44) + public var activeColor_inverted = Color(uiColor: .mvmGray65) + public var inverted = false //-------------------------------------------------- @@ -53,6 +56,8 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode case enabledColor_inverted case disabledColor case disabledColor_inverted + case activeColor + case activeColor_inverted case inverted } @@ -92,6 +97,14 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode if let disabledColor_inverted = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledColor_inverted) { self.disabledColor_inverted = disabledColor_inverted } + + if let activeColor = try typeContainer.decodeIfPresent(Color.self, forKey: .activeColor) { + self.activeColor = activeColor + } + + if let activeColor_inverted = try typeContainer.decodeIfPresent(Color.self, forKey: .activeColor_inverted) { + self.activeColor_inverted = activeColor_inverted + } } public func encode(to encoder: Encoder) throws { @@ -107,5 +120,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol, EnableableMode try container.encode(enabledColor_inverted, forKey: .enabledColor_inverted) try container.encode(disabledColor, forKey: .disabledColor) try container.encode(disabledColor_inverted, forKey: .disabledColor_inverted) + try container.encode(activeColor, forKey: .activeColor) + try container.encode(activeColor_inverted, forKey: .activeColor_inverted) } } diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 78363630..4bc84c87 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -52,6 +52,8 @@ extension UIColor { "coolGray3": (.mvmCoolGray3, "#D8DADA"), "coolGray6": (.mvmCoolGray6, "#747676"), "coolGray10": (.mvmCoolGray10, "#333333"), + "gray44": (.mvmGray44, "#6F7171"), + "gray65": (.mvmGray65, "#A7A7A7"), "upGold1": (.vzupGold1, "#F9D542"), "upGold2": (.vzupGold2, "#F4CA53"), "upGold3": (.vzupGold3, "#CC9B2D")] @@ -197,6 +199,12 @@ extension UIColor { /// HEX: #333333 public static let mvmCoolGray10 = UIColor.assetColor(named: "coolGray10") + /// HEX: #6F7171 + public static let mvmGray44 = UIColor.assetColor(named: "gray44") + + /// HEX: #A7A7A7 + public static let mvmGray65 = UIColor.assetColor(named: "gray65") + //-------------------------------------------------- // MARK: - VZ UP Brand //-------------------------------------------------- diff --git a/MVMCoreUI/Categories/colors.xcassets/Contents.json b/MVMCoreUI/Categories/colors.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/MVMCoreUI/Categories/colors.xcassets/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} 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/gray65.colorset/Contents.json b/MVMCoreUI/Categories/colors.xcassets/gray65.colorset/Contents.json new file mode 100644 index 00000000..aefc9ce0 --- /dev/null +++ b/MVMCoreUI/Categories/colors.xcassets/gray65.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xA7", + "green" : "0xA7", + "red" : "0xA7" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}