Skip to content

Commit

Permalink
TASK: Prepend color values with "#" if a numeric string is given
Browse files Browse the repository at this point in the history
  • Loading branch information
mficzel committed Jul 16, 2018
1 parent 7bb84d3 commit c9d3844
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/DummyImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function imageAction (int $width = 600, int $height = 400, string $backgr

// create imagine
$palette = new Palette\RGB();
$bgColor = $palette->color($backgroundColor);
$textColor = $palette->color($foregroundColor);
$bgColor = $palette->color(is_numeric($backgroundColor) ? '#' . $backgroundColor : $backgroundColor);
$textColor = $palette->color(is_numeric($foregroundColor) ? '#' . $foregroundColor : $foregroundColor);

// create image
$imageBox = new Box($width, $height);
Expand Down

0 comments on commit c9d3844

Please sign in to comment.