Skip to content

Commit

Permalink
Merge pull request #317 from neccohuang/fix-lineWidth-lineColor
Browse files Browse the repository at this point in the history
fix: lineWidth & lineColor
  • Loading branch information
mewebstudio authored Nov 5, 2024
2 parents 06a28c6 + 1fd2cd6 commit 70fc129
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ class Captcha
*/
protected $lines = 3;

/**
* @var int
*/
protected $lineWidth = 2;

/**
* @var string
*/
protected $lineColor = 'ff00ff';

/**
* @var string
*/
Expand Down Expand Up @@ -456,8 +466,8 @@ protected function lines()
$this->image->drawLine(function (LineFactory $line) use ($i) {
$line->from(rand(0, $this->image->width()) + $i * rand(0, $this->image->height()) , rand(0, $this->image->height()));
$line->to( rand(0, $this->image->width()), rand(0, $this->image->height()));
$line->color('ff00ff'); // color of line
$line->width(5); // line width in pixels
$line->color($this->lineColor); // color of line
$line->width($this->lineWidth); // line width in pixels
});
}

Expand Down

0 comments on commit 70fc129

Please sign in to comment.