From 5bbcdeff55989927438b84ca87f0c96777c848e7 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 27 Jun 2013 04:27:32 +0300 Subject: [PATCH] Run function to go through the steps automatically. Just add $filename and $destination and we're set. --- palette.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/palette.php b/palette.php index 93b006d..664182b 100644 --- a/palette.php +++ b/palette.php @@ -82,6 +82,17 @@ class Palette } } + public function run() + { + if (empty($this->destination)) { + throw new Exception("No destination provided, can't save.") + } + + $this->isImage(); + $this->getPalette(); + $this->save(); + } + /** * getPalette * Returns colors used in an image specified in $filename