Cotton code
83 lines · 3.9 KB · SwiftRaw
// The materials the music's objects are made of, and the felt they lie on.//// A material is NOT a palette role: it is the colour of a thing — the// charcoal wool felt of a turntable's mat (the owner's music pictures,// `music-look-dark`, 29 Oct 2026: "a deep warm charcoal, about #2A2826"), the// dark inside a cassette's window, its brown oxide tape, the white figures on// its counter's wheels — read off the reference the way a paper's dye is read// off its photograph (`PaperDye`). The cassette's case, shell, hubs, pack,// counter and papers are paintings (`Media.xcassets`, the cassette's// materials); these are the few colours drawn live beside them, and the felt's// colour under its painted tile. It does not flip with the theme: a mat is// charcoal and a tape is brown whatever the app is doing.// `PaletteGuardTests` exempts this file from the CHANNELS sweep for that// sentence and no other; it writes no hex and names nothing.import SwiftUI/// The music's materials.public enum MusicMaterial: String, CaseIterable, Sendable {    /// The warm charcoal felt a music object lies on (`FaceGround.felt`): the    /// painted felt tile's own mean colour.    case felt    /// The dark seen through a cassette's window, behind its reels.    case window    /// Magnetic tape, running between the reels: its oxide brown.    case tape    /// The white figures printed on a tape counter's wheels.    case figure    /// The black pebbled tolex a hi-fi deck stands on (`FaceGround.tolex`):    /// the painted tolex tile's own mean colour.    case tolex    /// The cream engraved on a hi-fi's black plate: its song's name, the    /// times round its knob.    case engraving    /// The black printed on a level meter's cream card: its figures and    /// its letters.    case print    /// Polished brass, lit by the lamp (a single's favourite star), and    /// its shade on the side away from the lamp.    case brass    case brassShade    /// The black printed on a single's cream label: its name, its artist,    /// its rule and its length.    case labelInk    /// An album's spine where its cover gives no colour: a warm grey stock.    case spine    /// The dark wood dance floor the party's turntable stands on    /// (`FaceGround.partyFloor`): the painted floor tile's own mean colour.    case floor    /// The red and the cream printed on the party's black label, read off    /// its painted rings: its song's name in the red, its artist, its album    /// and its times in the cream.    case partyRed    case partyCream    /// The cream panel at the left of the tray's strip (`album.tray`,    /// `song.tray`), the title and the artist typed on it, read off Round    /// 21's proof.    case panel    /// The hand a cassette's label is written in (its `layout.json`'s    /// `#30291f`): a warm brown-black ink.    case hand    public var colour: Color {        switch self {        case .felt: Color(red: 0.165, green: 0.157, blue: 0.149)        case .window: Color(red: 0.075, green: 0.065, blue: 0.06)        case .tape: Color(red: 0.24, green: 0.13, blue: 0.09)        case .figure: Color(red: 0.96, green: 0.95, blue: 0.91)        case .tolex: Color(red: 0.113, green: 0.113, blue: 0.111)        case .engraving: Color(red: 0.91, green: 0.85, blue: 0.75)        case .print: Color(red: 0.12, green: 0.11, blue: 0.1)        case .brass: Color(red: 0.86, green: 0.69, blue: 0.38)        case .brassShade: Color(red: 0.52, green: 0.37, blue: 0.16)        case .labelInk: Color(red: 0.13, green: 0.11, blue: 0.1)        case .spine: Color(red: 0.3, green: 0.29, blue: 0.27)        case .floor: Color(red: 0.172, green: 0.077, blue: 0.028)        case .partyRed: Color(red: 0.89, green: 0.235, blue: 0.15)        case .partyCream: Color(red: 0.89, green: 0.73, blue: 0.56)        case .panel: Color(red: 0.918, green: 0.843, blue: 0.682)        case .hand: Color(red: 0.188, green: 0.161, blue: 0.122)        }    }}