Cotton code
63 lines · 2.8 KB · SwiftRaw
// The colours of Cotton Calling's things where they are not painted.//// The desk telephone is painted (`telephone`, `telephone-front`,// `telephone-lifted`, by `scripts/paint-telephone.py`, 13 Nov 2026) and// stands on the calling desk's oxblood leather (`GroundMaterial`). What is// drawn live over the paint, or beside it, takes its colour from here: a// call's memory slip, its paper, the black and the red of its two-colour// ribbon and the grey of its rules; a contact's ivory card and the ink it// is typed in; a photograph's white border; the glow of a lit line key and// the ink its glyph is moulded in; the gilt a call's words are tooled in on// the leather; and, where a build carries no pictures, the telephone's// cream. A material is NOT a palette role: it is the colour of a thing,// read off its painting the way a paper's dye is read off its photograph// (`PaperDye`), and it does not flip with the theme. `PaletteGuardTests`// exempts this file from the CHANNELS sweep for that sentence and no other;// it writes no hex and names nothing.import SwiftUI/// Cotton Calling's materials.public enum CallingMaterial: String, CaseIterable, Sendable {    /// A memory slip's paper, a printer roll's warm white.    case slip    /// The black half of the slip's two-colour ribbon.    case ribbon    /// The red half: a missed call is printed in it.    case ribbonRed    /// The slip's dashed rules, the ribbon worn thin.    case rule    /// A contact's ivory card.    case card    /// The ink a contact's card is typed and printed in.    case cardInk    /// A photograph's white border.    case border    /// The telephone's cream plastic, where a build carries no pictures.    case cream    /// The warm lamp behind a line key that is on.    case glow    /// The brown a glyph is moulded into a line key in.    case keyInk    /// The red key's glyph, moulded in its cream.    case keyInkOnRed    /// The gilt a call's name and state are tooled in on the leather.    case gilt    public var colour: Color {        switch self {        case .slip: Color(red: 0.957, green: 0.941, blue: 0.902)        case .ribbon: Color(red: 0.137, green: 0.125, blue: 0.125)        case .ribbonRed: Color(red: 0.722, green: 0.141, blue: 0.118)        case .rule: Color(red: 0.541, green: 0.522, blue: 0.494)        case .card: Color(red: 0.949, green: 0.922, blue: 0.851)        case .cardInk: Color(red: 0.149, green: 0.137, blue: 0.157)        case .border: Color(red: 0.965, green: 0.957, blue: 0.929)        case .cream: Color(red: 0.914, green: 0.863, blue: 0.749)        case .glow: Color(red: 1.0, green: 0.776, blue: 0.408)        case .keyInk: Color(red: 0.333, green: 0.271, blue: 0.220)        case .keyInkOnRed: Color(red: 0.965, green: 0.902, blue: 0.812)        case .gilt: Color(red: 0.851, green: 0.718, blue: 0.455)        }    }}