{"record":{"id":"b8c929a8f8e61ddb","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-json-colors","errorCode":null,"errorMessage":"theme.json.colors 字段无效","messagePattern":"theme\\.json\\.colors 字段无效","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":1071,"sourceCode":"    if let Some(art) = object.get(\"art\") {\n        validate_theme_art(art)?;\n    }\n    if let Some(colors) = object.get(\"colors\") {\n        let colors = colors.as_object().context(\"theme.json.colors 必须是对象\")?;\n        let keys = [\n            \"background\",\n            \"panel\",\n            \"panelAlt\",\n            \"accent\",\n            \"accentAlt\",\n            \"secondary\",\n            \"highlight\",\n            \"text\",\n            \"muted\",\n            \"line\",\n        ];\n        if colors.len() != keys.len() {\n            bail!(\"theme.json.colors 字段无效\");\n        }\n        for key in keys {\n            if colors\n                .get(key)\n                .and_then(Value::as_str)\n                .is_none_or(|value| !valid_theme_color(value))\n            {\n                bail!(\"theme.json.colors 缺少 {key}\");\n            }\n        }\n    }\n    Ok(())\n}\n\nfn validate_manifest_files(\n    manifest: &DreamSkinPackageManifest,\n    manifest_bytes: &[u8],\n    theme_bytes: &[u8],","sourceCodeStart":1053,"sourceCodeEnd":1089,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L1053-L1089","documentation":"Thrown by validate_theme when the optional theme.json.colors object does not have exactly the 10 expected keys (background, panel, panelAlt, accent, accentAlt, secondary, highlight, text, muted, line). The offending input is the colors object's key set — both missing keys and extra keys trip this because count != 10; per-key value validation happens in the loop after.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1071 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["让 colors 恰好包含规范的 10 个颜色键","删除多余或拼错的键"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}