Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
import SwiftUI
struct ContentView: View {
var body: some View {
Canvas { context, size in
let center = CGPoint(x: size.width/2, y: size.height/2)
for r in stride(from: 20.0, through: 180.0, by: 20.0) {
let rect = CGRect(x: center.x-r, y: center.y-r, width: r*2, height: r*2)
context.stroke(Path(ellipseIn: rect), with: .color(Color(hue: r/200, saturation: 1, brightness: 1)), lineWidth: 4)
}
}
}
}Coding works best on desktop or with an external keyboard.