RedeyeVentures\GeoPattern\GeoPattern::geoConcentricCircles PHP Method

geoConcentricCircles() protected method

protected geoConcentricCircles ( )
    protected function geoConcentricCircles()
    {
        $scale = $this->hexVal(0, 1);
        $ringSize = $this->map($scale, 0, 15, 10, 60);
        $strokeWidth = $ringSize / 5;
        $this->svg->setWidth(($ringSize + $strokeWidth) * 6)->setHeight(($ringSize + $strokeWidth) * 6);
        $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);
                $cx = $x * $ringSize + $x * $strokeWidth + ($ringSize + $strokeWidth) / 2;
                $cy = $y * $ringSize + $y * $strokeWidth + ($ringSize + $strokeWidth) / 2;
                $halfRingSize = $ringSize / 2;
                $this->svg->addCircle($cx, $cy, $halfRingSize, ['fill' => 'none', 'stroke' => $fill, 'style' => ['opacity' => $opacity, 'stroke-width' => "{$strokeWidth}px"]]);
                $val = $this->hexVal(39 - $i, 1);
                $opacity = $this->opacity($val);
                $fill = $this->fillColor($val);
                $quarterRingSize = $ringSize / 4;
                $this->svg->addCircle($cx, $cy, $quarterRingSize, ['fill' => $fill, 'fill-opacity' => $opacity]);
                $i++;
            }
        }
    }