-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from dark color to labelColor to fix darkmode issues. #3766
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3766 +/- ##
=======================================
Coverage 32.67% 32.67%
=======================================
Files 114 114
Lines 10754 10754
=======================================
Hits 3514 3514
Misses 7240 7240
Continue to review full report at Codecov.
|
it's not exactly correct I did not look at the problem for ios
and also create "Assets.xcassets" |
in fact the problem is the assignment of the kind
rather AppKit etc ..... UIKit is poor for the Color |
@Jean-Daniel feedback to @thierryH91200? |
If you want to use custom color and an asset catalog, you should use NSImage(named:bundle:), and place the asset catalog in the framework. |
@thierryH91200 I'm not sure what your issue with this PR is. macOS does provide a default label color for standard and dark modes and we should use it. For UIKit, this happens to be black, but it's reasonable to expect the API to exist in UIKit in the near future as well. @Jean-Daniel please resolve conflicts |
{ | ||
static var labelColor : UIColor | ||
{ | ||
return UIColor.black |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that this is an old PR, but if UIColor.label is returned here, we can get Dark Mode support for labels on iOS as well, which would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply removing the declaration will solve the issue for iOS 13+.
extension UIColor {
@available(iOS, introduced: 9.0, obsoleted: 13.0)
@available(tvOS, introduced: 9.0, obsoleted: 13.0)
static var label: UIColor { .black }
}
and doing the same for NSColor
extension NSColor {
@available(macOS, introduced: 10.11, obsoleted: 10.14)
static var label: UIColor { .black }
}
I'm going to look at the dark mode stuff recently. I know this is an old pr and there is a new one:#3742, which seems doing the same thing. from my comment #4171 (comment), we need to talk about a few things before. Can anyone reply? Thanks. |
Issue Link 🔗
#3742
Goals ⚽
This change does not fix all Dark mode issues, but is (hopefully) a step in the right direction.