1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
<?php
namespace Scene7\Commands\Layer;
trait Blur
{
/**
* @param float $radius
* @return $this
*/
public function setBlur($radius)
{
$radius = (float) $radius;
if ($radius < 0 || $radius > 100) {
throw new \InvalidArgumentException('Radius must be between 0 and 100');
}
$this->addCommand(['op_blur' => $radius]);
return $this;
}
}