The Color(hex:) initializer in Theme.swift:69-77 uses Scanner.scanHexInt64 which returns 0 (black) on parse failure. No validation, no error. Not user-facing today (the color picker uses presets), but if anyone hand-edits a sidecar with "#XYZ" or "red" they get invisible marks.
Suggested fix. Make the initializer failable (init?(hex: String)) and handle nil at call sites with a fallback color, or assert in debug builds and fall back to accent in release.
References. Sources/mindle/Theme.swift:69-77.
The
Color(hex:)initializer inTheme.swift:69-77usesScanner.scanHexInt64which returns 0 (black) on parse failure. No validation, no error. Not user-facing today (the color picker uses presets), but if anyone hand-edits a sidecar with"#XYZ"or"red"they get invisible marks.Suggested fix. Make the initializer failable (
init?(hex: String)) and handle nil at call sites with a fallback color, or assert in debug builds and fall back to accent in release.References.
Sources/mindle/Theme.swift:69-77.