Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
ensure fill color for group is expanded to correct hex value
  • Loading branch information
steinsag committed Nov 10, 2013
1 parent 181abf2 commit c128195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions phpqrcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -3575,15 +3575,15 @@ private static function vectSVG($frame, $pixelPerPoint = 4, $outerFrame = 4, $ba
'<desc></desc>'."\n";

if(!empty($back_color)) {
$backgroundcolor = dechex($back_color);
$backgroundcolor = str_pad(dechex($back_color), 6, "0");
$output .= '<rect width="'.$imgW * $pixelPerPoint.'" height="'.$imgH * $pixelPerPoint.'" fill="#'.$backgroundcolor.'" cx="0" cy="0" />'."\n";
}

$output .=
'<defs>'."\n".
'<rect id="p" width="'.$pixelPerPoint.'" height="'.$pixelPerPoint.'" />'."\n".
'</defs>'."\n".
'<g fill="#'.dechex($fore_color).'">'."\n";
'<g fill="#'.str_pad(dechex($fore_color), 6, "0").'">'."\n";


// Convert the matrix into pixels
Expand Down
6 changes: 3 additions & 3 deletions qrvect.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ private static function vectSVG($frame, $pixelPerPoint = 4, $outerFrame = 4, $ba
'<desc></desc>'."\n";

if(!empty($back_color)) {
$backgroundcolor = dechex($back_color);
$backgroundcolor = str_pad(dechex($back_color), 6, "0");
$output .= '<rect width="'.$imgW * $pixelPerPoint.'" height="'.$imgH * $pixelPerPoint.'" fill="#'.$backgroundcolor.'" cx="0" cy="0" />'."\n";
}

$output .=
'<defs>'."\n".
'<rect id="p" width="'.$pixelPerPoint.'" height="'.$pixelPerPoint.'" />'."\n".
'</defs>'."\n".
'<g fill="#'.dechex($fore_color).'">'."\n";
'<g fill="#'.str_pad(dechex($fore_color), 6, "0").'">'."\n";


// Convert the matrix into pixels
Expand All @@ -195,4 +195,4 @@ private static function vectSVG($frame, $pixelPerPoint = 4, $outerFrame = 4, $ba
}
}



0 comments on commit c128195

Please sign in to comment.