Code Duplication    Length = 9-10 lines in 2 locations

includes/libraries/Pdf/Tfpdf/tfpdf.class.php 2 locations

@@ 422-431 (lines=10) @@
419
    return $this->page;
420
}
421
422
function SetDrawColor($r, $g = null, $b = null)
423
{
424
    // Set color for all stroking operations
425
    if (($r == 0 && $g == 0 && $b == 0) || $g === null) {
426
            $this->DrawColor = sprintf('%.3F G', $r / 255);
427
    } else {
428
            $this->DrawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255);
429
    }
430
    if ($this->page > 0) {
431
            $this->_out($this->DrawColor);
432
    }
433
    }
434
@@ 449-457 (lines=9) @@
446
    }
447
    }
448
449
function SetTextColor($r, $g = null, $b = null)
450
{
451
    // Set color for text
452
    if (($r == 0 && $g == 0 && $b == 0) || $g === null) {
453
            $this->TextColor = sprintf('%.3F g', $r / 255);
454
    } else {
455
            $this->TextColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255);
456
    }
457
    $this->ColorFlag = ($this->FillColor != $this->TextColor);
458
}
459
460
function GetStringWidth($s)