// The pencilled oval round a face's selected part (the invitation, 28 Oct// 2026, `lake-place-selected.png`): drawn by hand in the theme's mark// (`palette.faces.mark`), two passes of a soft pencil that do not quite// close, the first heavier and uneven, the second lighter and a little off.// A face rings a part with `.pencilRinged(_:)`; nothing is drawn when the// part is not the selected one.importCottonPaperimportCottonValuesimportSwiftUIenumPencilRingKnobs {/// The two passes' widths: a pencil pressed, then lifted.staticlet heavy: CGFloat = 1.5staticlet light: CGFloat = 0.9/// The second pass's strength.staticlet lightOpacity: Double = 0.75}/// Two passes of a pencil round an oval, with the pressure varying along/// the first so its stroke is uneven.structPencilRing: View { @Environment(\.theme) privatevar themepublicinit() {}publicvar body: someView {let mark = theme.faceStocks.mark ZStack {PenRing(start: 0.58, sweep: 1.05, tilt: -1.6) .stroke(mark, style: StrokeStyle(lineWidth: PencilRingKnobs.heavy, lineCap: .round))// Pressure: a thicker run over part of the first pass.PenRing(start: 0.78, sweep: 0.42, tilt: -1.6) .stroke(mark.opacity(0.6), style: StrokeStyle(lineWidth: PencilRingKnobs.heavy * 1.6, lineCap: .round))PenRing(start: 0.08, sweep: 0.86, tilt: -0.4, squash: 0.95) .stroke(mark.opacity(PencilRingKnobs.lightOpacity), style: StrokeStyle(lineWidth: PencilRingKnobs.light, lineCap: .round)) .offset(x: 1.2, y: 0.8) } .blendMode(theme.printBlend) .allowsHitTesting(false) .accessibilityHidden(true) }}extensionView {/// This view is the card's `part`: ringed in pencil, reaching `reach`/// beyond it, when it is the selected part (`selectedFacePart`).publicfunc pencilRinged(_ part: FacePart, reach: EdgeInsets) -> someView { modifier(PencilRinged(part: part, reach: reach)) }}privatestructPencilRinged: ViewModifier {let part: FacePartlet reach: EdgeInsets @Environment(\.selectedFacePart) privatevar selectedfunc body(content: Content) -> someView { content .overlay {if selected == part {PencilRing() .padding(EdgeInsets(top: -reach.top, leading: -reach.leading, bottom: -reach.bottom, trailing: -reach.trailing)) } } .accessibilityAddTraits(selected == part ? .isSelected : []) }}