// The inks of the faces' own pieces on a card's paper: every colour is the// theme's (`palette.faces`), every strength the card paper's scale. The// face-only pieces — a tag of paper, a photograph's mount, the initials'// mount — keep their inks here; the stock each face is printed on is the// face's own (`onCardPaper`, CottonPaper's `CardPaper`).importCottonPaperimportSwiftUI/// The inks of the faces' own pieces, as the worn theme says them/// (`palette.faces`); an ink's strength is its colour's alpha.publicstructFaceStockTokens {publicvar cream: Colorpublicvar buff: Colorpublicvar shadow: Colorpublicvar shadowOpacity: Doublepublicvar ornament: Colorpublicvar ruling: Colorpublicvar margin: Colorpublicvar mountInk: Color/// The slip of paper the corner's words sit on (image 2a).publicvar cornerSlip: Color/// The aged-cream mount round a photograph (image 9).publicvar printMount: Color/// The pencilled mark round a face's selected part.publicvar mark: Colorpublicvar passportInk: Colorpublicvar passportStamps: [Color]}extensionTheme {publicvar faceStocks: FaceStockTokens {let faces = colors.facesfunc ink(_ key: String) -> Color { faces[key]?.color ?? .clear }returnFaceStockTokens( cream: ink("cream"), buff: ink("buff"), shadow: ink("shadow"), shadowOpacity: Double(scale[.cardShadowOpacity]), ornament: ink("ornament"), ruling: ink("ruling"), margin: ink("margin"), mountInk: ink("initials"), cornerSlip: ink("slip"), printMount: ink("mount"), mark: ink("mark"), passportInk: ink("passport_ink"), passportStamps: [ink("passport_red"), ink("passport_violet"), ink("passport_blue"), ink("passport_brown")] ) }}/// Typed ink on the stock: the colour, multiplied into the fibre.structFaceInk: ViewModifier {let ink: PaperInk @Environment(\.theme) privatevar themefunc body(content: Content) -> someView { content .foregroundStyle(theme.print(ink)) .blendMode(theme.printBlend) }}extensionView {publicfunc faceInk(_ ink: PaperInk) -> someView { modifier(FaceInk(ink: ink)) }}/// A photograph mounted on the card: square-cut, flat to the stock, a hair/// of shadow where it lifts (image 2a's portrait).publicstructMountedPrint<Photo: View>: View {/// The picture, filling whatever frame it is given.let photo: Photo @Environment(\.theme) privatevar themepublicinit(photo: Photo) {self.photo = photo }publicvar body: someView {Color.clear .overlay(photo) .clipped() .shadow(color: theme.colors.shadow.color.opacity(theme.faceStocks.shadowOpacity), radius: 1.2, x: 0, y: 0.8) .accessibilityHidden(true) }}