Skip to content

Commit

Permalink
improve fill color
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Mar 17, 2018
1 parent bef983a commit 4aa2366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion color.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ public function getColor($r=null, $g=null, $b=null)

public function fill($oGd, BaseColor $bgColor)
{
imagefill($oGd, 0, 0, $bgColor->toGd($oGd));
$pImg = \PMVC\plug('image');
imagefill(
$pImg->getGd($oGd),
0,
0,
$bgColor->toGd($oGd)
);
}

public function hexToRgb($hex)
Expand Down
3 changes: 2 additions & 1 deletion src/BaseColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ function toRound()
*/
function toGd($image)
{
$pImg = \PMVC\plug('image');
return imagecolorallocate(
$image,
$pImg->getGd($image),
$this->r,
$this->g,
$this->b
Expand Down

0 comments on commit 4aa2366

Please sign in to comment.