Grafika\DrawingObject\Line::__construct PHP Method

__construct() public method

Creates a line.
public __construct ( array $point1, array $point2, integer $thickness = 1, Color | string $color = '#000000' )
$point1 array Array containing int X and int Y position of the starting point.
$point2 array Array containing int X and int Y position of the starting point.
$thickness integer Thickness in pixel. Note: This is currently ignored in GD editor and falls back to 1.
$color Grafika\Color | string Color of the line. Defaults to black.
    public function __construct(array $point1, array $point2, $thickness = 1, $color = '#000000')
    {
        if (is_string($color)) {
            $color = new Color($color);
        }
        $this->point1 = $point1;
        $this->point2 = $point2;
        $this->thickness = $thickness;
        $this->color = $color;
    }