[ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
1 <?php 2 /* 3 * This work is hereby released into the Public Domain. 4 * To view a copy of the public domain dedication, 5 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to 6 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 7 * 8 */ 9 10 11 require_once dirname(__FILE__)."/../Graph.class.php"; 12 13 14 /** 15 * Create your gradients 16 * 17 * @package Artichow 18 */ 19 class awGradient { 20 21 /** 22 * From color 23 * 24 * @var Color 25 */ 26 var $from; 27 28 /** 29 * To color 30 * 31 * @var Color 32 */ 33 var $to; 34 35 /** 36 * Build the gradient 37 * 38 * @param $from From color 39 * @param $to To color 40 */ 41 function awGradient($from, $to) { 42 43 $this->from = $from; 44 $this->to = $to; 45 46 } 47 48 /** 49 * Free memory used by the colors of the gradient 50 */ 51 function free() { 52 53 $this->from->free(); 54 $this->to->free(); 55 56 } 57 58 function php5Destructor( ){ 59 60 $this->free(); 61 62 } 63 64 } 65 66 registerClass('Gradient', TRUE); 67 68 69 /** 70 * Create a linear gradient 71 * 72 * @package Artichow 73 */ 74 class awLinearGradient extends awGradient { 75 76 /** 77 * Gradient angle 78 * 79 * @var int 80 */ 81 var $angle; 82 83 /** 84 * Build the linear gradient 85 * 86 * @param $from From color 87 * @param $to To color 88 * @param int $angle Gradient angle 89 */ 90 function awLinearGradient($from, $to, $angle) { 91 92 parent::awGradient( 93 $from, $to 94 ); 95 96 $this->angle = $angle; 97 98 } 99 100 } 101 102 registerClass('LinearGradient'); 103 104 105 /** 106 * Create a bilinear gradient 107 * 108 * @package Artichow 109 */ 110 class awBilinearGradient extends awLinearGradient { 111 112 /** 113 * Gradient center 114 * 115 * @var int Center between 0 and 1 116 */ 117 var $center; 118 119 /** 120 * Build the bilinear gradient 121 * 122 * @param $from From color 123 * @param $to To color 124 * @param int $angle Gradient angle 125 * @param int $center Gradient center 126 */ 127 function awBilinearGradient($from, $to, $angle, $center = 0.5) { 128 129 parent::awLinearGradient( 130 $from, $to, $angle 131 ); 132 133 $this->center = $center; 134 135 } 136 137 } 138 139 registerClass('BilinearGradient'); 140 141 /** 142 * Create a radial gradient 143 * 144 * @package Artichow 145 */ 146 class awRadialGradient extends awGradient { 147 148 } 149 150 registerClass('RadialGradient'); 151 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |