// The one mount a person without a photograph shows, on every face that// draws a person: a quiet wash, their initial ringed in pencil with a fainter// echo of the ring, in the look's monogram ink.importCottonPaperimportCottonValuesimportSwiftUIenumInitialsMountKnobs {/// The monogram's ring and letter, as shares of the mount's shorter side.staticlet ringShare: CGFloat = 0.72staticlet letterShare: CGFloat = 0.42staticlet washOpacity: Double = 0.2staticlet ringOpacity: Double = 0.75staticlet ringLine: CGFloat = 1.2/// The pencil's second pass round the ring, a hair off the first.staticlet echoOpacity: Double = 0.35staticlet echoLine: CGFloat = 0.8staticlet echoStretch = CGSize(width: 1.02, height: 0.99)staticlet echoShift = CGSize(width: 1.2, height: -0.8)}/// The one mount a person without a photograph shows, on every face: a quiet/// wash, their initial ringed in pencil with a fainter echo of the ring, in/// the look's monogram ink. Round mounts clip it; the person's panel frames it.publicstructInitialsMount: View {let name: Stringlet typed: Bool @Environment(\.theme) privatevar themepublicinit(name: String, typed: Bool = false) {self.name = nameself.typed = typed }publicvar body: someView {GeometryReader { mount inlet side = min(mount.size.width, mount.size.height)let ring = side * InitialsMountKnobs.ringShareif typed { ZStack { theme.sheet(.cream)Text(CardPerson.initials(name) ?? "") .font(CottonFonts.type(side * 0.35)) .foregroundStyle(theme.faceStocks.mountInk) .blendMode(theme.printBlend) } .frame(width: mount.size.width, height: mount.size.height) } else { ZStack { theme.faceStocks.buff.opacity(InitialsMountKnobs.washOpacity) .blendMode(theme.printBlend)Circle() .stroke(theme.print(.pencil).opacity(InitialsMountKnobs.ringOpacity), lineWidth: InitialsMountKnobs.ringLine) .frame(width: ring, height: ring)Circle() .stroke(theme.print(.pencil).opacity(InitialsMountKnobs.echoOpacity), lineWidth: InitialsMountKnobs.echoLine) .frame(width: ring * InitialsMountKnobs.echoStretch.width, height: ring * InitialsMountKnobs.echoStretch.height) .offset(InitialsMountKnobs.echoShift)Text(CardPerson.initials(name).map { String($0.prefix(1)) } ?? "") .font(CottonFonts.display(side * InitialsMountKnobs.letterShare)) .foregroundStyle(theme.faceStocks.mountInk) .blendMode(theme.printBlend) } .frame(width: mount.size.width, height: mount.size.height) } } .accessibilityHidden(true) }}