{"record":{"id":"0bf4e2f6af197840","repo":"bevyengine/bevy","slug":"invalid-hex-string","errorCode":null,"errorMessage":"Invalid hex string","messagePattern":"Invalid hex string","errorType":"validation","errorClass":"HexColorError","httpStatus":null,"severity":"error","filePath":"crates/bevy_color/src/srgba.rs","lineNumber":436,"sourceCode":"}\n\n#[cfg(feature = \"wgpu-types\")]\nimpl From<Srgba> for wgpu_types::Color {\n    fn from(color: Srgba) -> Self {\n        wgpu_types::Color {\n            r: color.red as f64,\n            g: color.green as f64,\n            b: color.blue as f64,\n            a: color.alpha as f64,\n        }\n    }\n}\n\n/// Error returned if a hex string could not be parsed as a color.\n#[derive(Debug, Error, PartialEq, Eq)]\npub enum HexColorError {\n    /// Parsing error.\n    #[error(\"Invalid hex string\")]\n    Parse(#[from] core::num::ParseIntError),\n    /// Invalid length.\n    #[error(\"Unexpected length of hex string\")]\n    Length,\n    /// Invalid character.\n    #[error(\"Invalid hex char\")]\n    Char(char),\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::testing::assert_approx_eq;\n\n    use super::*;\n\n    #[test]\n    fn test_to_from_linear() {\n        let srgba = Srgba::new(0.0, 0.5, 1.0, 1.0);","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_color/src/srgba.rs#L418-L454","documentation":"HexColorError::Parse: the integer portion of the hex color string failed to parse (e.g. non-hex digits where digits were expected). It wraps the underlying ParseIntError; commonly triggered by strings like '#GG0000' or stray characters in the hex literal.","triggerScenarios":"Thrown at crates/bevy_color/src/srgba.rs:436 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only hexadecimal digits (0-9, a-f) in the color string","Remove stray characters or whitespace before parsing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}