Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context, size in
for _ in 0..<300 {
let x = CGFloat.random(in: 0...size.width)
let y = CGFloat.random(in: 0...size.height)
let rect = CGRect(x: x, y: y, width: 6, height: 6)
context.fill(Path(ellipseIn: rect), with: .color(Color(hue: .random(in: 0...1), saturation: 1, brightness: 1)))
}
}
}
}Coding works best on desktop or with an external keyboard.