Intervention/image · error · InvalidArgumentException
Color level for argument $blue must be in range -100 to 100
Error message
Color level for argument $blue must be in range -100 to 100
What it means
Error "Color level for argument $blue must be in range -100 to 100" thrown in Intervention/image.
Source
Thrown at src/Modifiers/ColorizeModifier.php:31
* Create new modifier object.
*
* @throws InvalidArgumentException
*/
public function __construct(
public int $red = 0,
public int $green = 0,
public int $blue = 0,
) {
if ($red < -100 || $red > 100) {
throw new InvalidArgumentException('Color level for argument $red must be in range -100 to 100');
}
if ($green < -100 || $green > 100) {
throw new InvalidArgumentException('Color level for argument $green must be in range -100 to 100');
}
if ($blue < -100 || $blue > 100) {
throw new InvalidArgumentException('Color level for argument $blue must be in range -100 to 100');
}
}
}
View on GitHub (pinned to 5598b9e397)
Solutions
- Pass a blue channel level between -100 and 100 to colorize()
- Clamp computed values with max(-100, min(100, $blue))
- Validate form/API input ranges before calling colorize
When it happens
Trigger: Thrown at src/Modifiers/ColorizeModifier.php:31 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Intervention/image@5598b9e397 (2026-08-23).
Data as JSON: /api/errors/4c0cf9d0a95c7ceb.
Report an issue: GitHub.