Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/BrianMcdo/ImagePalette/ImagePalette.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ImagePalette implements IteratorAggregate
* @param int $paletteLength
* @param string $library
*/
public function __construct($file, $precision = 10, $paletteLength = 5, $library = 'gd')
public function __construct($file, $precision = 10, $paletteLength = 5, $library = 'gd', $whiteList = array())
{
$this->file = $file;
$this->precision = $precision;
Expand All @@ -107,6 +107,10 @@ public function __construct($file, $precision = 10, $paletteLength = 5, $library
// use provided libname or auto-detect
$this->lib = $this->graphicsLibrary($library);

if (!empty($whiteList)) {
$this->whiteList = $whiteList;
}

// create an array with color ints as keys
$this->whiteList = array_fill_keys($this->whiteList, 0);

Expand Down