//
//  GradientButtonView.swift
//  PhysicalWallPaper
//
//  Created by nkl on 2024/11/12.
//

import Foundation
import SwiftUI

struct GradientBackgroundModifier: ViewModifier {
    var colors : [Color]

    func body(content: Content) -> some View {
        content
            .background(
                LinearGradient(gradient: Gradient(colors: colors), startPoint: .leading, endPoint: .trailing)
            )
    }
}

extension View {
    func gradientBackground(colors:[Color]) -> some View {
        modifier(GradientBackgroundModifier(colors: colors))
    }
}
