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

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

protected geoChevrons ( )
    protected function geoChevrons()
    {
        $chevronWidth = $this->map($this->hexVal(0, 1), 0, 15, 30, 80);
        $chevronHeight = $this->map($this->hexVal(0, 1), 0, 15, 30, 80);
        $chevron = $this->buildChevronShape($chevronWidth, $chevronHeight);
        $this->svg->setWidth($chevronWidth * 6)->setHeight($chevronHeight * 6 * 0.66);
        $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 = ['stroke' => self::STROKE_COLOR, 'stroke-opacity' => self::STROKE_OPACITY, 'stroke-width' => '1', 'fill-opacity' => $opacity, 'fill' => $fill];
                $group = new Group();
                $group->addItem($chevron[0])->addItem($chevron[1]);
                $xChevronWidth = $x * $chevronWidth;
                $yPointSixSixChevronHeightMinusHalfChevronHeight = $y * $chevronHeight * 0.66 - $chevronHeight / 2;
                $this->svg->addGroup($group, array_merge($styles, ['transform' => "translate({$xChevronWidth},{$yPointSixSixChevronHeightMinusHalfChevronHeight})"]));
                // Add an extra row at the end that matches the first row, for tiling.
                if ($y == 0) {
                    $sixPointSixSixChevronHeightMinusHalfChevronHeight = 6 * $chevronHeight * 0.66 - $chevronHeight / 2;
                    $this->svg->addGroup($group, array_merge($styles, ['transform' => "translate({$xChevronWidth},{$sixPointSixSixChevronHeightMinusHalfChevronHeight})"]));
                }
                $i++;
            }
        }
    }