DotPattern
is a SwiftUI component for generating a dot pattern background. It provides customization options for setting the dot color, spacing between dots, brightness, and background color.
DotPattern.swift
file in your SwiftUI project. File Link
dotColor: Color
(Default: Color.blue
) - The color of the dots.spacing: CGFloat
(Default: 0
) - Additional spacing between dots.brightness: Double
(Default: 1.0
, Range: 0.0-1.0
) - Opacity of the dots.backgroundColor: Color
(Default: Color.black
) - The background color of the pattern.DotPattern
component with default parameters:
DotPattern
component with custom parameters: