{"record":{"id":"6d5ec243ceb14b1c","repo":"PHPOffice/PhpSpreadsheet","slug":"invalid-hex-color-for-chart-series-color-s","errorCode":null,"errorMessage":"Invalid hex color for chart series (color: \"%s\")","messagePattern":"Invalid hex color for chart series \\(color: \"(.+?)\"\\)","errorType":"exception","errorClass":"PhpOffice\\PhpSpreadsheet\\Chart\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/Chart/DataSeriesValues.php","lineNumber":340,"sourceCode":"            }\n        } elseif ($color instanceof ChartColor) {\n            $this->fillColor = $color;\n        } else {\n            $this->fillColor = $this->stringToChartColor($color);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Method for validating hex color.\n     *\n     * @param string $color value for color\n     */\n    private function validateColor(string $color): void\n    {\n        if (!preg_match('/^[a-f0-9]{6}$/i', $color)) {\n            throw new Exception(sprintf('Invalid hex color for chart series (color: \"%s\")', $color));\n        }\n    }\n\n    /**\n     * Get line width for series.\n     */\n    public function getLineWidth(): null|float|int\n    {\n        /** @var null|float|int */\n        $temp = $this->lineStyleProperties['width'];\n\n        return $temp;\n    }\n\n    /**\n     * Set line width for the series.\n     *\n     * @return $this","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/Chart/DataSeriesValues.php#L322-L358","documentation":"Error \"Invalid hex color for chart series (color: \"%s\")\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/Chart/DataSeriesValues.php:340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}