Cotton code
69 lines · 3.0 KB · SwiftRaw
// The colours of Cotton Health's instruments, where they are not painted.//// The brass pedometer, the nickel stopwatch and the brass tag are painted// (`health-pedometer`, `health-stopwatch`, `health-tag`, `health-glass`, by// `scripts/paint-health.py`), lying on the honed slate (`FaceGround.slate`).// What is drawn live over the paint takes its colour from here: the blued// steel of a hand, the red lacquer of the usual's tick, the near-black a dial// is printed in, the dark brass a tag is engraved in and the light its cut// catches, the four blues a night's stages are enamelled in, the rose of a// period's mark, the pale chalk words are written on the slate in, and, where// a build carries no pictures, the brass, the nickel and the enamel// themselves. A material is NOT a palette role: it is the colour of a thing,// read off the painting the way a paper's dye is read off its photograph, 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 Health's materials.public enum HealthMaterial: String, CaseIterable, Sendable {    /// A hand's blued steel.    case bluedSteel    /// The usual's tick, red lacquer.    case lacquer    /// What a dial is printed in.    case dialInk    /// The dark brass a tag's words are engraved in.    case engraving    /// The light an engraving's cut catches.    case engravingLight    /// A night's deep sleep, the darkest of the dial's blues.    case deep    /// A night's core sleep.    case core    /// A night's REM sleep.    case rem    /// A night's time awake, the palest.    case awake    /// The period's mark on a dial's rim.    case rose    /// Words chalked on the slate beside an instrument.    case chalk    /// The brass, where a build carries no pictures.    case brass    /// The nickel, where a build carries no pictures.    case nickel    /// A dial's cream enamel, where a build carries no pictures.    case enamel    public var colour: Color {        switch self {        case .bluedSteel: Color(red: 0.15, green: 0.23, blue: 0.43)        case .lacquer: Color(red: 0.70, green: 0.13, blue: 0.11)        case .dialInk: Color(red: 0.13, green: 0.12, blue: 0.10)        case .engraving: Color(red: 0.30, green: 0.21, blue: 0.07)        case .engravingLight: Color(red: 0.96, green: 0.86, blue: 0.58)        case .deep: Color(red: 0.11, green: 0.18, blue: 0.40)        case .core: Color(red: 0.22, green: 0.36, blue: 0.62)        case .rem: Color(red: 0.42, green: 0.58, blue: 0.82)        case .awake: Color(red: 0.78, green: 0.84, blue: 0.92)        case .rose: Color(red: 0.80, green: 0.32, blue: 0.40)        case .chalk: Color(red: 0.90, green: 0.92, blue: 0.93)        case .brass: Color(red: 0.79, green: 0.63, blue: 0.32)        case .nickel: Color(red: 0.77, green: 0.78, blue: 0.80)        case .enamel: Color(red: 0.96, green: 0.93, blue: 0.85)        }    }}