RedeyeVentures\GeoPattern\GeoPattern::geoNestedSquares PHP Метод

geoNestedSquares() защищенный Метод

protected geoNestedSquares ( )
    protected function geoNestedSquares()
    {
        $blockSize = $this->map($this->hexVal(0, 1), 0, 15, 4, 12);
        $squareSize = $blockSize * 7;
        $dimension = ($squareSize + $blockSize) * 6 + $blockSize * 6;
        $this->svg->setWidth($dimension)->setHeight($dimension);
        $i = 0;
        for ($y = 0; $y <= 5; $y++) {
            for ($x = 0; $x <= 5; $x++) {
                $val = $this->hexVal($i, 1);
                $opacity = $this->opacity($val);
                $fill = $this->fillColor($val);
                $styles = ['fill' => 'none', 'stroke' => $fill, 'style' => ['opacity' => $opacity, 'stroke-width' => "{$blockSize}px"]];
                $rX = $x * $squareSize + $x * $blockSize * 2 + $blockSize / 2;
                $rY = $y * $squareSize + $y * $blockSize * 2 + $blockSize / 2;
                $this->svg->addRectangle($rX, $rY, $squareSize, $squareSize, $styles);
                $val = $this->hexVal(39 - $i, 1);
                $opacity = $this->opacity($val);
                $fill = $this->fillColor($val);
                $styles = ['fill' => 'none', 'stroke' => $fill, 'style' => ['opacity' => $opacity, 'stroke-width' => "{$blockSize}px"]];
                $rX2 = $x * $squareSize + $x * $blockSize * 2 + $blockSize / 2 + $blockSize * 2;
                $rY2 = $y * $squareSize + $y * $blockSize * 2 + $blockSize / 2 + $blockSize * 2;
                $this->svg->addRectangle($rX2, $rY2, $blockSize * 3, $blockSize * 3, $styles);
                $i++;
            }
        }
    }