protected function drawScratch($img, $imageWidth, $imageHeight, $hex)
    {
        $rgb = $this->hexToRgb($hex);

        imageline(
            $img,
            mt_rand(0, floor($imageWidth / 2)),
            mt_rand(1, $imageHeight),
            mt_rand(floor($imageWidth / 2), $imageWidth),
            mt_rand(1, $imageHeight),
            imagecolorallocate($img, $rgb['r'], $rgb['g'], $rgb['b'])
        );
    }
protected function drawScratch($img, $imageWidth, $imageHeight, $hex)
    {
        $rgb = $this->hexToRgb($hex);

        imageline(
            $img,
            mt_rand(0, floor($imageWidth / 2)),
            mt_rand(1, $imageHeight),
            mt_rand(floor($imageWidth / 2), $imageWidth),
            mt_rand(1, $imageHeight),
            imagecolorallocate($img, $rgb['r'], $rgb['g'], $rgb['b'])
        );
    }
protected function drawScratch ( $ img , $ imageWidth , $ imageHeight , $ hex ) { $ rgb = $ this -> hexToRgb ( $ hex ) ; imageline ( $ img , mt_rand ( 0 , floor ( $ imageWidth / 2 ) ) , mt_rand ( 1 , $ imageHeight ) , mt_rand ( floor ( $ imageWidth / 2 ) , $ imageWidth ) , mt_rand ( 1 , $ imageHeight ) , imagecolorallocate ( $ img , $ rgb [ 'r' ] , $ rgb [ 'g' ] , $ rgb [ 'b' ] ) ) ; }
Draw scratches.

@param resource $img
@param int $imageWidth
@param int $imageHeight
@param string $hex
Draw scratches .