Skip to content
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

Dark Mode Support #104

Open
rlaurb opened this issue Sep 15, 2020 · 0 comments
Open

Dark Mode Support #104

rlaurb opened this issue Sep 15, 2020 · 0 comments

Comments

@rlaurb
Copy link

rlaurb commented Sep 15, 2020

As of 9.2.1, Marky-Mark does not support dark mode. I have made this change in my local copy, but suggest that adding this to Marky-Mark on an official basis would be both simple and valuable.

The approach I used was to change all references to specific colors in the Marky-Mark code to new custom colors. For example, I replaced all references to UIColor.black to UIColor.mmText, where mmText is defined below:

extension UIColor {
	static let mmLigthTranslucentGray : UIColor = {
		if #available(iOS 13, *) {
			return UIColor.systemGray4.withAlphaComponent(0.25)
		} else {
			return UIColor.lightGray.withAlphaComponent(0.25)
		}
	}()
	
	static let mmGray : UIColor = {
		if #available(iOS 13, *) {
			return UIColor.systemGray
		} else {
			return UIColor.gray
		}
	}()
	
	static let mmText : UIColor = {
		if #available(iOS 13, *) {
			return UIColor.label
		} else {
			return .black
		}
	}()
	
	static let mmBackground : UIColor = {
		if #available(iOS 13, *) {
			return UIColor.secondarySystemBackground
		} else {
			return UIColor.gray
		}
	}()
	
	static let mmGrayText : UIColor = {
		if #available(iOS 13, *) {
			return UIColor.secondaryLabel
		} else {
			return UIColor.gray
		}
	}()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant