๐Ÿ”ฐForeground

// set background material
view
    // material layer
    // material works best when there is a background layer
    .background(.ultraThinMaterial)
    
    // background layer
    .background(Image("Blob 1"))    // image from assets
    
// a material with a particular shape
view.background(.regularMaterial, in: RoundedRectangle(cornerRadius: 8))
    
// foreground style (text gradient)
text.foregroundStyle(.linearGradient(
    colors    : [.primary, .primary.opacity(0.5)], 
    startPoint: .topLeading, 
    endPoint  : .bottomTrailing
))

Last updated