From b88c2a861d8a52372de246ed9997f8784d756b5b Mon Sep 17 00:00:00 2001 From: Alex Rock Ancelet Date: Fri, 9 Feb 2018 10:40:12 +0100 Subject: [PATCH] Add "xc" to allow creating images with "X window color" --- CommandOptions.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CommandOptions.php b/CommandOptions.php index 49beea0..3a5faa5 100644 --- a/CommandOptions.php +++ b/CommandOptions.php @@ -79,6 +79,18 @@ public function size($geometry) return $this; } + /** + * @param string $canvasColor + * + * @return $this + */ + public function xc(string $canvasColor = 'none') + { + $this->command .= ' xc:' . $this->escape($this->ref->color($canvasColor)).' '; + + return $this; + } + /** * @param string|Geometry $geometry * @@ -86,7 +98,7 @@ public function size($geometry) */ public function crop($geometry) { - $this->command .= ' -crop ' . $this->escape($this->ref->geometry($geometry)).' '; + $this->command .= ' -crop ' . $this->escape($this->ref->geometry($geometry), false).' '; return $this; }