title: SwiftUI: Using Color Set from Asset Catalog
body: <p>In SwiftUI, we can get a color from a color set in an asset catalog using:</p>
  <pre><code>extension Color {
      static let coral = Color(&quot;coral&quot;)
  }
  </code></pre>
  <p>This requires stringly-typed names and gets quite tedious with many color sets. Is there another way to get color sets similar to how we use image literals to get images from an asset catalog? Or, just something less redundant.</p>
  <p>If not, how are dynamic colors programmatically created in SwiftUI? For example, this is how it would be done in UIKit:</p>
  <pre><code>extension UIColor {
      static let dynamicColor = UIColor { $0.userInterfaceStyle == .dark ? .black : .white }
  }
  </code></pre>