renovate[bot] a091044c2e chore(deps): update dependency phpunit/phpunit to v10.3.3 (#39)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 12:45:56 +03:00
2022-06-26 18:40:33 +03:00
2017-09-13 18:03:48 +03:00
2017-09-13 18:03:12 +03:00
2017-09-13 17:59:13 +03:00
2022-06-26 18:40:33 +03:00
2022-11-28 16:42:30 +02:00

Palette Build Status

Palette is a PHP class that takes your images and returns used colors, sorts them by usage and saves the results.

Usage

After adding Palette to your composer.json file and installed to your vendor folder, you can use the class like this:

With default settings

$image = "example/example.jpg";
$palette = new \ivuorinen\Palette\Palette($image);
print_r($palette->colorsArray);

With custom settings

$palette = new \ivuorinen\Palette\Palette();

$palette->filename     = "example/example.jpg"; // Our image
$palette->precision    = 10; // Precision of color collection
$palette->returnColors = 10; // How many colors we want
$palette->destination  = './data/' . md5($palette->filename) . '.json';

// Do the work (same as ``Palette::run()``)
$this->getPalette();
$this->save(); // Not needed, but caching results <3

// We now have ``./data/7233c3b944f5299c6983c77c94e75dce.json`` (if everything went smoothly)
// and we can test against it before running palette generation. Which you should do really.

print_r($palette->colorsArray);
Description
No description provided
Readme MIT 353 KiB
Languages
PHP 100%