docs: colors, views, and string

This commit is contained in:
greyder 2022-06-05 11:53:32 +08:00
parent 3b0834a87a
commit 6017cd29d9
3 changed files with 7 additions and 1 deletions

View File

@ -1,9 +1,14 @@
import SwiftUI import SwiftUI
/// View with a colored background
public struct BackgroundView<Content: View>: View { public struct BackgroundView<Content: View>: View {
let color: Color let color: Color
var content: () -> Content var content: () -> Content
/// Create a View with a background color
/// - Parameters:
/// - color: background color
/// - content: view over the background color
public init(color: Color = .background, @ViewBuilder content: @escaping () -> Content) { public init(color: Color = .background, @ViewBuilder content: @escaping () -> Content) {
self.color = color self.color = color
self.content = content self.content = content

View File

@ -8,6 +8,7 @@
import UIKit import UIKit
import SwiftUI import SwiftUI
/// Additional colors used by the package
public extension Color { public extension Color {
static var background: Color { static var background: Color {