{"record":{"id":"9a284884ba0e730a","repo":"Intervention/image","slug":"color-level-for-argument-red-must-be-in-range-10","errorCode":null,"errorMessage":"Color level for argument $red must be in range -100 to 100","messagePattern":"Color level for argument \\$red must be in range -100 to 100","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Modifiers/ColorizeModifier.php","lineNumber":23,"sourceCode":"namespace Intervention\\Image\\Modifiers;\n\nuse Intervention\\Image\\Drivers\\SpecializableModifier;\nuse Intervention\\Image\\Exceptions\\InvalidArgumentException;\n\nclass ColorizeModifier extends SpecializableModifier\n{\n    /**\n     * Create new modifier object.\n     *\n     * @throws InvalidArgumentException\n     */\n    public function __construct(\n        public int $red = 0,\n        public int $green = 0,\n        public int $blue = 0,\n    ) {\n        if ($red < -100 || $red > 100) {\n            throw new InvalidArgumentException('Color level for argument $red must be in range -100 to 100');\n        }\n\n        if ($green < -100 || $green > 100) {\n            throw new InvalidArgumentException('Color level for argument $green must be in range -100 to 100');\n        }\n\n        if ($blue < -100 || $blue > 100) {\n            throw new InvalidArgumentException('Color level for argument $blue must be in range -100 to 100');\n        }\n    }\n}\n","sourceCodeStart":5,"sourceCodeEnd":35,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Modifiers/ColorizeModifier.php#L5-L35","documentation":"Error \"Color level for argument $red must be in range -100 to 100\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Modifiers/ColorizeModifier.php:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a red channel level between -100 and 100 to colorize()","Clamp computed values with max(-100, min(100, $red))","Validate form/API input ranges before calling colorize"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5598b9e39751c34afc5cdee84abef77f92c26f68","analyzedAt":"2026-08-23T02:17:31.068Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}