1<?php 2 3/** 4 * pChart - a PHP class to build charts! 5 * 6 * http://pchart.sourceforge.net 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 1,2,3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22class GridStyle { 23 public function __construct($lineWidth, $mosaic = true, Color $color = null, $alpha = 100) { 24 if($color == null) { 25 $color = new Color(220, 220, 220); 26 } 27 28 if($alpha > 100 || $alpha < 0) { 29 throw new InvalidArgumentException("Bad alpha argument specified to ".__METHOD__); 30 } 31 32 $this->lineWidth = $lineWidth; 33 $this->mosaic = $mosaic; 34 $this->color = $color; 35 $this->alpha = $alpha; 36 } 37 38 public function getLineWidth() { 39 return $this->lineWidth; 40 } 41 42 public function getMosaic() { 43 return $this->mosaic; 44 } 45 46 public function getColor() { 47 return $this->color; 48 } 49 50 public function getAlpha() { 51 return $this->alpha; 52 } 53 54 private $lineWidth; 55 private $mosaic; 56 private $color; 57 private $alpha; 58}