View UIColor+Attenuated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIColor { | |
/// Creates a dynamic color from the receiver with attenuated brightness. | |
/// | |
/// This method works correctly with light and dark mode. A dynamic color is | |
/// returned, so if the user switches to dark mode, the attenuated dark mode version of `self` | |
/// will be displayed. | |
func attenuated(by attenuation: CGFloat) -> UIColor { |
View UIColor+Blended.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIColor { | |
/// Creates a dynamic color from the receiver blended with another color. | |
/// | |
/// If `weight` is 0, the color of `self` is returned. If `weight` is 1, the color | |
/// of `otherColor` is returned. | |
/// | |
/// This method works correctly with light and dark mode. A dynamic color is |
View gist:dac0b0c6da8b445600aadc6eaca9e942
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're using SwiftLint, add this to your swiftlint.yml to make Xcode | |
# generate warnings when you create new Swift files and Xcode inserts the | |
# filename where the package name should be. | |
custom_rules: | |
# This calls out an Xcode 13 bug where the header comments of newly created | |
# files include the file name where the package name should be. | |
xcode_13_header_comment_bug: | |
regex: ' *\/\/ *([A-Za-z0-9_]*?).swift *\n *\/\/ *\1 *\n' | |
message: "Incorrect header comment package name" |