Skip to content

Commit

Permalink
BSButton's fill color was too dark in light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krugerk committed Oct 6, 2024
1 parent 23d5bcf commit 34dd0a4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion BeeKit/UI/BSButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ public class BSButton : UIButton {
func setUp() {
self.titleLabel?.font = UIFont.beeminder.defaultBoldFont
self.setTitleColor(UIColor.Beeminder.yellow, for: UIControl.State())
self.tintColor = .black
self.tintColor = dynamicTintFillColor
self.configuration = .filled()

self.layer.borderColor = UIColor.Beeminder.yellow.cgColor
self.layer.borderWidth = 1
self.layer.cornerRadius = 4
}

private let dynamicTintFillColor = UIColor { traitCollection in
switch traitCollection.userInterfaceStyle {
case .dark:
return UIColor.black
default:
return UIColor(red: 59.0/255.0,
green: 59.0/255.0,
blue: 59.0/255.0,
alpha: 0.5)
}
}
}

0 comments on commit 34dd0a4

Please sign in to comment.