// A picture a face shows, by its key. The face does not know where pictures// come from: the app draws a key from the phone (`PagePicture` in CottonUI,// installed as `facePictureDrawer`), the Loom app and the face shots from// their bundled fixtures. Unset, a picture draws nothing — a// visible hole, never a stand-in.importSwiftUIpublicstructFacePicture: View {publiclet key: String/// The longest side it is drawn at, in points: what the drawer asks the/// phone for.publiclet edge: CGFloat @Environment(\.facePictureDrawer) privatevar drawerpublicinit(key: String, edge: CGFloat) {self.key = keyself.edge = edge }publicvar body: someView { drawer(key, edge) }}/// How a `FacePicture` is drawn: the key and the edge in, the picture out.publictypealiasFacePictureDrawer = @MainActor @Sendable (_ key: String, _ edge: CGFloat) -> AnyView/// A picture's shape by its key: its width over its height, as whatever/// draws pictures knows it; nil where it does not. A card carries no/// picture's shape, and a face that lays a picture at its own shape (a lab/// print) asks this: the Loom app and the face shots answer from their/// fixtures' files (`FixturePictures.aspect`); the phone answers nothing/// until a kit names such a face.publictypealiasFacePictureAspect = @MainActor @Sendable (_ key: String) -> CGFloat?/// A picture's colour by its key: the mean of its pixels, as whatever/// draws pictures knows it; nil where it does not. A card carries no/// picture's colour, and a face that tints its stock from a picture (an/// album's spine behind an artist's divider) asks this: the Loom app and/// the face shots answer from their fixtures' files (`FixturePictures.tint`);/// the phone answers nothing until its pictures are read for it.publictypealiasFacePictureTint = @MainActor @Sendable (_ key: String) -> Color?extensionEnvironmentValues { @Entry publicvar facePictureDrawer: FacePictureDrawer = { _, _ inAnyView(EmptyView()) } @Entry publicvar facePictureAspect: FacePictureAspect = { _ innil } @Entry publicvar facePictureTint: FacePictureTint = { _ innil }}