1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-16 10:48:49 +01:00

Fix some colors (#690)

This commit is contained in:
Nathan Mattes 2022-12-18 02:08:58 +01:00
parent 669716208e
commit 62fe8d5881
9 changed files with 58 additions and 27 deletions

View File

@ -30,8 +30,8 @@ extension CategoryPickerSection {
if cell.isSelected {
textColor = .white
backgroundColor = Asset.Colors.Primary._700.color
borderColor = Asset.Colors.Primary._700.color
backgroundColor = Asset.Colors.Brand.blurple.color
borderColor = Asset.Colors.Brand.blurple.color
} else {
textColor = .label
backgroundColor = .clear

View File

@ -30,7 +30,7 @@ final class OnboardingNextView: UIView {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.layer.cornerRadius = 14
button.backgroundColor = Asset.Colors.brand.color
button.backgroundColor = Asset.Colors.Brand.blurple.color
button.setTitle(L10n.Common.Controls.Actions.next, for: .normal)
return button
}()

View File

@ -36,27 +36,4 @@ final class MastodonServerRulesViewModel {
self.instance = instance
self.applicationToken = applicationToken
}
var rulesAttributedString: NSAttributedString {
let attributedString = NSMutableAttributedString(string: "\n")
let configuration = UIImage.SymbolConfiguration(font: .preferredFont(forTextStyle: .title3))
let separatorString = Array(repeating: " ", count: 4).joined()
for (i, rule) in rules.enumerated() {
guard i < 50 else {
return NSAttributedString(string: "\(i)" + separatorString + rule.text.trimmingCharacters(in: .whitespacesAndNewlines) + "\n\n")
}
let imageName = String(i + 1) + ".circle"
let image = UIImage(systemName: imageName, withConfiguration: configuration)!
let attachment = NSTextAttachment()
attachment.image = image.withTintColor(Asset.Colors.brand.color)
let imageAttribute = NSMutableAttributedString(attachment: attachment)
imageAttribute.addAttributes([NSAttributedString.Key.baselineOffset : -1.5], range: NSRange(location: 0, length: imageAttribute.length))
let ruleString = NSAttributedString(string: separatorString + rule.text.trimmingCharacters(in: .whitespacesAndNewlines) + "\n\n")
attributedString.append(imageAttribute)
attributedString.append(ruleString)
}
return attributedString
}
}

View File

@ -22,7 +22,7 @@ extension ServerRuleSection {
case .rule(let ruleContext):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ServerRulesTableViewCell.self), for: indexPath) as! ServerRulesTableViewCell
cell.indexImageView.image = UIImage(systemName: "\(ruleContext.index + 1).circle") ?? UIImage(systemName: "questionmark.circle")
cell.indexImageView.tintColor = Asset.Colors.brand.color
cell.indexImageView.tintColor = Asset.Colors.Brand.lightBlurple.color
cell.ruleLabel.text = ruleContext.rule.text
return cell
}

View File

@ -60,6 +60,7 @@ extension OnboardingViewControllerAppearance {
func setupNavigationBarAppearance() {
// use TransparentBackground so view push / dismiss will be more visual nature
// please add opaque background for status bar manually if needs
navigationController?.navigationBar.tintColor = Asset.Colors.Brand.blurple.color
let barAppearance = UINavigationBarAppearance()
barAppearance.configureWithTransparentBackground()

View File

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

View File

@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}

View File

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

View File

@ -45,6 +45,10 @@ public enum Asset {
public static let searchCard = ColorAsset(name: "Colors/Border/searchCard")
public static let status = ColorAsset(name: "Colors/Border/status")
}
public enum Brand {
public static let blurple = ColorAsset(name: "Colors/Brand/Blurple")
public static let lightBlurple = ColorAsset(name: "Colors/Brand/Light Blurple")
}
public enum Button {
public static let actionToolbar = ColorAsset(name: "Colors/Button/action.toolbar")
public static let disabled = ColorAsset(name: "Colors/Button/disabled")