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 22require_once(dirname(__FILE__).'/Color.php'); 23 24class GridStyle { 25 public function __construct($lineWidth, $mosaic = true, Color $color = null, $alpha = 100) { 26 if ($color == null) { 27 $color = new Color(220, 220, 220); 28 } 29 30 if ($alpha > 100 || $alpha < 0) { 31 throw new InvalidArgumentException("Bad alpha argument specified to ".__METHOD__); 32 } 33 34 $this->lineWidth = $lineWidth; 35 $this->mosaic = $mosaic; 36 $this->color = $color; 37 $this->alpha = $alpha; 38 } 39 40 public function getLineWidth() { 41 return $this->lineWidth; 42 } 43 44 public function getMosaic() { 45 return $this->mosaic; 46 } 47 48 public function getColor() { 49 return $this->color; 50 } 51 52 public function getAlpha() { 53 return $this->alpha; 54 } 55 56 private $lineWidth; 57 private $mosaic; 58 private $color; 59 private $alpha; 60}