Commit 4e610241 authored by Nicolas Widart's avatar Nicolas Widart

Adding limitColors implementation

parent 2fa97ce1
......@@ -2,6 +2,7 @@
return [
'smallThumb' => [
// 'crop' => [
// 'width' => '100',
// 'height' => '200'
......@@ -38,6 +39,10 @@ return [
// $constraint->upsize();
// }
// ]
'invert' => [],
// 'invert' => [],
'limitColors' => [
'count' => 90,
'matte' => '#ff9900'
],
]
];
<?php namespace Modules\Media\Image\Intervention\Manipulations;
use Modules\Media\Image\ImageHandlerInterface;
class LimitColors implements ImageHandlerInterface
{
private $defaults = [
'count' => 255,
'matte' => null
];
/**
* Handle the image manipulation request
* @param \Intervention\Image\Image $image
* @param array $options
* @return \Intervention\Image\Image
*/
public function handle($image, $options)
{
$options = array_merge($this->defaults, $options);
return $image->limitColors($options['count'], $options['matte']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment