@@ -31,7 +31,7 @@ |
||
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | $step = 1 / (count($colors) - 1); |
| 34 | - $offsets = array_map(function ($item) { |
|
| 34 | + $offsets = array_map(function($item) { |
|
| 35 | 35 | return $item % 1 !== 0 ? sprintf('%0.2f', $item) : $item; |
| 36 | 36 | }, range(0, 1, $step)); |
| 37 | 37 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | ]; |
| 71 | 71 | foreach ($pointConfig as $key => $value) { |
| 72 | 72 | if (isset($pointLightConfig[$key])) { |
| 73 | - $pointConfig[$key] = $this->{$key} + $pointLightConfig[$key]; |
|
| 73 | + $pointConfig[$key] = $this->{$key} +$pointLightConfig[$key]; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | $filter = DiffuseLighting::diffusePointLight($this->getRoot(), $pointConfig, $diffuseLightingConfig, $filterId); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public function append(ElementInterface $elements) |
| 21 | 21 | { |
| 22 | 22 | /** @var ElementInterface[] $elements */ |
| 23 | - $elements = array_filter(func_get_args(), function ($item) { |
|
| 23 | + $elements = array_filter(func_get_args(), function($item) { |
|
| 24 | 24 | return $item instanceof ElementInterface; |
| 25 | 25 | }); |
| 26 | 26 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $defs = new Defs($svg); |
| 18 | 18 | |
| 19 | 19 | $linearGradient = UniformGradient::uniformGradient($defs, ['#ff0000', '#00ff00', '#0000ff', '#000000'], null); |
| 20 | -KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 100, 'y1' => 0, 'x2' => 600, 'y2' => 0,]); |
|
| 20 | +KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 100, 'y1' => 0, 'x2' => 600, 'y2' => 0, ]); |
|
| 21 | 21 | |
| 22 | 22 | $g = new G($svg); |
| 23 | 23 | $g->apply(['fontFamily' => 'Verdana', 'fontSize' => 75, 'fontWeight' => 'bold', 'fill' => "url(#$linearGradient->id)"]); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | require_once __DIR__ . '/../vendor/autoload.php'; |
| 10 | 10 | |
| 11 | -$style = ['stroke' => 'lightgray', 'stroke-width' => 0.5, 'rx' => 3, 'ry' => 3,]; |
|
| 11 | +$style = ['stroke' => 'lightgray', 'stroke-width' => 0.5, 'rx' => 3, 'ry' => 3, ]; |
|
| 12 | 12 | $colors = ['#1D4350', '#A43931']; |
| 13 | 13 | |
| 14 | 14 | $svg = new SVG(800, 800); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $defs = new Defs($svg); |
| 23 | 23 | |
| 24 | 24 | $linearGradient = UniformGradient::uniformGradient($defs, ['#000000', '#ffffff', '#ff0000', '#808080'], null); |
| 25 | -KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 100, 'y1' => 0, 'x2' => 300, 'y2' => 0,]); |
|
| 25 | +KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 100, 'y1' => 0, 'x2' => 300, 'y2' => 0, ]); |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | $defs->append($linearGradient); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $rect->ry = 5; |
| 21 | 21 | $rect->stroke = 'darkgreen'; |
| 22 | 22 | $rect->fill = 'limegreen'; |
| 23 | -$rect->strokeWidth = 1.5; // In this particular case strokeWidth will be converted into stroke-width. |
|
| 23 | +$rect->strokeWidth = 1.5; // In this particular case strokeWidth will be converted into stroke-width. |
|
| 24 | 24 | |
| 25 | 25 | // Or use apply method. |
| 26 | 26 | $rect->apply(['stroke' => 'darkgreen', 'fill' => 'limegreen', 'stroke-width' => 1.5]); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $defs = new Defs($svg); |
| 21 | 21 | |
| 22 | 22 | $linearGradient = UniformGradient::uniformGradient($defs, ['#ff00ff', '#88ff88', '#2020ff', '#d00000'], null); |
| 23 | -KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 0, 'y1' => 0, 'x2' => $svg->getElement()->getAttribute('width'), 'y2' => 0,]); |
|
| 23 | +KeyValueWriter::apply($linearGradient->getElement(), ['gradientUnits' => 'userSpaceOnUse', 'x1' => 0, 'y1' => 0, 'x2' => $svg->getElement()->getAttribute('width'), 'y2' => 0, ]); |
|
| 24 | 24 | |
| 25 | 25 | $defs->append($linearGradient); |
| 26 | 26 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $path = new Path($svg, 100, 250); |
| 26 | 26 | $path->id = 'path1'; |
| 27 | -$path->curveTo(100,50, 400,50, 400,250); |
|
| 27 | +$path->curveTo(100, 50, 400, 50, 400, 250); |
|
| 28 | 28 | $path->fill = "none"; |
| 29 | 29 | $path->stroke = "blue"; |
| 30 | 30 | $path->strokeWidth = 7.06; |