TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file Theme.php

Documentation is available at Theme.php

  1. <?php
  2.  
  3. /**
  4.  * Theme class
  5.  *
  6.  * Description: Summary description for Theme
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage themes
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16. abstract class Theme extends TeeBase {
  17.  
  18.     // Interceptors
  19.     function __get$property {
  20.       $method ="get{$property}";
  21.       if method_exists$this$method ) ) {
  22.         return $this->$method();
  23.       }
  24.     }
  25.  
  26.     function __set $property,$value {
  27.       $method ="set{$property}";
  28.       if method_exists$this$method ) ) {
  29.         return $this->$method($value);
  30.       }
  31.     }
  32.  
  33.     public function Theme($c=null{
  34.         parent::__construct($c);
  35.     }
  36.  
  37.     public abstract function apply();
  38.  
  39.     /**
  40.      * Gets descriptive text.
  41.      *
  42.      * @return String 
  43.      */
  44.     public function getDescription({
  45.         return "Default";
  46.     }
  47.  
  48.     // Returns Theme
  49.     public function themeSelector($custom{
  50.         return null;
  51.     }
  52.  
  53.     public $themeSelectorHook = null;  // ThemeSelectorDelegate
  54.     public $newChartHook = null;  // ThemeSelectorDelegate
  55.  
  56.     // Returns Array of Color
  57.     public final static function getDefaultPalette({
  58.                                     return Array(
  59.                                                  Color::RED(),
  60.                                                  Color::GREEN(),
  61.                                                  Color::getYellow(),
  62.                                                  Color::BLUE(),
  63.                                                  Color::getWhite(),
  64.                                                  Color::getGray(),
  65.                                                  Color::getFuchsia(),
  66.                                                  Color::getTeal(),
  67.                                                  Color::getNavy(),
  68.                                                  Color::getMaroon(),
  69.                                                  Color::getLime(),
  70.                                                  Color::getOlive(),
  71.                                                  Color::getPurple(),
  72.                                                  Color::getSilver(),
  73.                                                  Color::getAqua(),
  74.                                                  Color::getBlack(),
  75.                                                  Color::getGreenYellow(),
  76.                                                  Color::getSkyBlue(),
  77.                                                  Color::getBisque(),
  78.                                                  Color::getIndigo()
  79.                                                  );
  80.     }
  81.  
  82.     public final static function getOperaPalette({
  83.                                   return Array(
  84.                                                Color::fromRgb(66,102,163)//blue
  85.                                                Color::fromRgb(243,156,53)//orange
  86.                                                Color::fromRgb(241,76,20)//red
  87.                                                Color::fromRgb(78,151,168)//blue
  88.                                                Color::fromRgb(43,64,107)//blue
  89.                                                Color::fromRgb(29,123,99)//blue-green dark
  90.                                                Color::fromRgb(179,8,14)//dark red
  91.                                                Color::fromRgb(242,192,93)//pale orange
  92.                                                Color::fromRgb(93,183,158)//blue-green
  93.                                                Color::fromRgb(112,112,112)//grey
  94.                                                Color::fromRgb(243,234,141)//yellow
  95.                                                Color::fromRgb(180,180,180//grey
  96.                                                );
  97.     }
  98.  
  99.     public final static function getOnBlackPalette({
  100.                                   return Array(
  101.                                                Color::fromRgb(20023090),
  102. //                                               Color::fromRgb(90, 150, 220),
  103.                                                Color::fromRgb(166198236),
  104. //                                               Color::fromRgb(230, 90, 40),
  105.                                                Color::fromRgb(240155123),
  106. //                                               Color::fromRgb(230, 160, 15),
  107.                                                Color::fromRgb(245199101),
  108.                                                Color::fromRgb(255255128)
  109.                                                );
  110.     }
  111.  
  112.     public final static function getCoolPalette({
  113.                                   return Array (
  114.                                                Utils::hex2rgb("2B406B")//dark blue
  115.                                                Utils::hex2rgb("3B548C")//blue
  116.                                                Utils::hex2rgb("4466A3")//blue
  117.                                                Utils::hex2rgb("4E97A8")//blue
  118.                                                Utils::hex2rgb("5DB79E")//blue-green
  119.                                                Utils::hex2rgb("41A08A")//blue-green
  120.                                                Utils::hex2rgb("2B927D")//blue-green
  121.                                                Utils::hex2rgb("1D7B63"//blue-green dark
  122.                                              );
  123.     }
  124.  
  125.     public final static function getWarmPalette({
  126.                                   return Array(
  127.                                                Utils::hex2rgb("F3EA8D")//yellow
  128.                                                Utils::hex2rgb("F2C05D")//pale orange
  129.                                                Utils::hex2rgb("F39C35")//orange
  130.                                                Utils::hex2rgb("F5811C")//orange
  131.                                                Utils::hex2rgb("F66B15")//dark orange
  132.                                                Utils::hex2rgb("F14C14")// red orange
  133.                                                Utils::hex2rgb("E6180A")// red
  134.                                                Utils::hex2rgb("B3080E"//dark red
  135.                                                );
  136.     }
  137.  
  138.     public final static function getMacOSPalette({
  139.                                   return Array(                        
  140.                                                Utils::hex2rgb("FFFFFF"),
  141.                                                Utils::hex2rgb("FCF305"),
  142.                                                Utils::hex2rgb("FF6402"),
  143.                                                Utils::hex2rgb("DD0806"),
  144.                                                Utils::hex2rgb("F20884"),
  145.                                                Utils::hex2rgb("4600A5"),
  146.                                                Utils::hex2rgb("0000D4"),
  147.                                                Utils::hex2rgb("02ABEA"),
  148.                                                Utils::hex2rgb("1FB714"),
  149.                                                Utils::hex2rgb("006411"),
  150.                                                Utils::hex2rgb("562C05"),
  151.                                                Utils::hex2rgb("90713A"),
  152.                                                Utils::hex2rgb("C0C0C0"),
  153.                                                Utils::hex2rgb("808080"),
  154.                                                Utils::hex2rgb("404040"),
  155.                                                Utils::hex2rgb("000000")
  156.                                                );
  157.     }
  158.  
  159.     public final static function getWindowsVistaPalette({
  160.                                   return Array(
  161.                                                Utils::hex2rgb("001FD2"),
  162.                                                Utils::hex2rgb("E00201"),
  163.                                                Utils::hex2rgb("1E6602"),
  164.                                                Utils::hex2rgb("E8CD7E"),
  165.                                                Utils::hex2rgb("AFABAC"),
  166.                                                Utils::hex2rgb("A4D0D9"),
  167.                                                Utils::hex2rgb("3D3B3C"),
  168.                                                Utils::hex2rgb("95DD31"),
  169.                                                Utils::hex2rgb("9E0001"),
  170.                                                Utils::hex2rgb("DCF774"),
  171.                                                Utils::hex2rgb("45FDFD"),
  172.                                                Utils::hex2rgb("D18E74"),
  173.                                                Utils::hex2rgb("A0D891"),
  174.                                                Utils::hex2rgb("D57A65"),
  175.                                                Utils::hex2rgb("9695D9")
  176.                                                );
  177.                                                
  178.                 /* vista palette
  179.             Utils::hex2rgb("FE9B82"),
  180.             Utils::hex2rgb("24D1FC"),
  181.             Utils::hex2rgb("0DBC7C"),
  182.             Utils::hex2rgb("2F85FD"),
  183.             Utils::hex2rgb("FCFEFD"),
  184.             Utils::hex2rgb("214EE2"),
  185.             Utils::hex2rgb("D63829"),
  186.             Utils::hex2rgb("0094B7"),
  187.             Utils::hex2rgb("00865A"),
  188.             Utils::hex2rgb("0046D2"),
  189.             Utils::hex2rgb("FAE5D3"),
  190.             Utils::hex2rgb("D8D8D8"),
  191.             Utils::hex2rgb("7B715F")
  192.             */                                               
  193.     }
  194.  
  195.     public final static function getExcelPalette()  {
  196.                                   return Array(
  197.                                                Utils::hex2rgb("FF9999"),
  198.                                                Utils::hex2rgb("663399"),
  199.                                                Utils::hex2rgb("CCFFFF"),
  200.                                                Utils::hex2rgb("FFFFCC"),
  201.                                                Utils::hex2rgb("660066"),
  202.                                                Utils::hex2rgb("8080FF"),
  203.                                                Utils::hex2rgb("CC6600"),
  204.                                                Utils::hex2rgb("FFCCCC"),
  205.                                                Utils::hex2rgb("800000"),
  206.                                                Utils::hex2rgb("FF00FF"),
  207.                                                Utils::hex2rgb("00FFFF"),
  208.                                                Utils::hex2rgb("FFFF00"),
  209.                                                Utils::hex2rgb("800080"),
  210.                                                Utils::hex2rgb("000080"),
  211.                                                Utils::hex2rgb("808000"),
  212.                                                Utils::hex2rgb("FF0000"),
  213.                                                Utils::hex2rgb("FFCC00"),
  214.                                                Utils::hex2rgb("FFFFCC"),
  215.                                                Utils::hex2rgb("CCFFCC"),
  216.                                                Utils::hex2rgb("00FFFF"),
  217.                                                Utils::hex2rgb("FFCC99"),
  218.                                                Utils::hex2rgb("CC99FF")
  219.                                                );
  220.     }
  221.  
  222.     public final static function getVictorianPalette({
  223.       return Array(
  224.             Utils::hex2rgb("5DA5A1"),
  225.             Utils::hex2rgb("C45331"),
  226.             Utils::hex2rgb("E79609"),
  227.             Utils::hex2rgb("F6E84A"),
  228.             Utils::hex2rgb("B1A2A7"),
  229.             Utils::hex2rgb("C9A784"),
  230.             Utils::hex2rgb("8C7951"),            
  231.             Utils::hex2rgb("D8CDB7"),
  232.             Utils::hex2rgb("086553"),
  233.             Utils::hex2rgb("F7D87B"),
  234.             Utils::hex2rgb("016484")       
  235. /*            
  236. Blues palette
  237.             Utils::hex2rgb("A1A55D"),
  238.             Utils::hex2rgb("3153C4"),
  239.             Utils::hex2rgb("0996E7"),
  240.             Utils::hex2rgb("4AE8F6"),
  241.             Utils::hex2rgb("A7A2B1"),
  242.             Utils::hex2rgb("84A7C9"),
  243.             Utils::hex2rgb("51798C"),
  244.             Utils::hex2rgb("B7CDD8"),
  245.             Utils::hex2rgb("536508"),
  246.             Utils::hex2rgb("7BD8F7"),
  247.             Utils::hex2rgb("846401")
  248.   */
  249.             
  250.             );
  251.     }
  252.  
  253.     public final static function getPastelsPalette()  {
  254.                                     return Array(
  255.                                                  Utils::hex2rgb("CCFFFF"),
  256.                                                  Utils::hex2rgb("FFFFCC"),
  257.                                                  Utils::hex2rgb("CCCCFF"),
  258.                                                  Utils::hex2rgb("00CCCC"),
  259.                                                  Utils::hex2rgb("CCCCCC"),
  260.                                                  Utils::hex2rgb("009999"),
  261.                                                  
  262.                                                  Utils::hex2rgb("999999"),
  263.                                                  Utils::hex2rgb("DDCCCC"),
  264.                                                  Utils::hex2rgb("FFCC66"),
  265.                                                  Utils::hex2rgb("CCCCFF"),
  266.                                                  Utils::hex2rgb("FF9999"),
  267.                                                  Utils::hex2rgb("FFFF99"),
  268.                                                  Utils::hex2rgb("99CCFF"),
  269.                                                  Utils::hex2rgb("CCFFCC"));
  270.     }
  271.  
  272.     public final static function getSolidPalette({
  273.                                   return Array(
  274.                                                Utils::hex2rgb("FF0000"),
  275.                                                Utils::hex2rgb("0000FF"),
  276.                                                Utils::hex2rgb("00FF00"),
  277.                                                Utils::hex2rgb("00CCFF"),
  278.                                                Utils::hex2rgb("404040"),
  279.                                                Utils::hex2rgb("00FFFF"),
  280.                                                Utils::hex2rgb("C000FF"),
  281.                                                Utils::hex2rgb("FFFFFF")
  282.                                                );
  283.     }
  284.  
  285.     public final static function getClassicPalette()  {
  286.                                     return Array(
  287.                                                  Utils::hex2rgb("FF0000"),
  288.                                                  Utils::hex2rgb("00FF00"),
  289.                                                  Utils::hex2rgb("FFFF00"),
  290.                                                  Utils::hex2rgb("0000FF"),
  291.                                                  Utils::hex2rgb("FF00FF"),
  292.                                                  Utils::hex2rgb("00FFFF"),
  293.                                                  Utils::hex2rgb("800000"),
  294.                                                  Utils::hex2rgb("008000"),
  295.                                                  Utils::hex2rgb("808000"),
  296.                                                  Utils::hex2rgb("000080"),
  297.                                                  Utils::hex2rgb("800080"),
  298.                                                  Utils::hex2rgb("008080")
  299.                                                  );
  300.     }
  301.  
  302.     public final static function getWebPalette({
  303.                                 return Array(
  304.                                              Utils::hex2rgb("00A5FF"),
  305.                                              Utils::hex2rgb("CE0000"),
  306.                                              Utils::hex2rgb("00CE00"),
  307.                                              Utils::hex2rgb("40FFFF"),
  308.                                              Utils::hex2rgb("FFFF40"),
  309.                                              Utils::hex2rgb("FF40FF"),
  310.                                              Utils::hex2rgb("0040FF"),
  311.                                              Utils::hex2rgb("A58080"),
  312.                                              Utils::hex2rgb("408080")
  313.                                              );
  314.     }
  315.  
  316.     public final static function getModernPalette()  {
  317.                                   return Array(
  318.                                                 Utils::hex2rgb("6699FF"),
  319.                                                 Utils::hex2rgb("6666FF"),
  320.                                                 Utils::hex2rgb("FFCC99"),
  321.                                                 Utils::hex2rgb("669966"),
  322.                                                 Utils::hex2rgb("99CCCC"),
  323.                                                 Utils::hex2rgb("CC6699"),
  324.                                                 Utils::hex2rgb("6666CC"),
  325.                                                 Utils::hex2rgb("99CCFF"),
  326.                                                 Utils::hex2rgb("FF6699"),
  327.                                                 Utils::hex2rgb("CCCCCC"),
  328.                                                 Utils::hex2rgb("CCFF66"),
  329.                                                 Utils::hex2rgb("FF9966"),
  330.                                                 Utils::hex2rgb("996699"),
  331.                                                 Utils::hex2rgb("FFCCCC")
  332.                                                 );
  333.     }
  334.  
  335.     public final static function getRainbowPalette({
  336.         return Array(
  337.                                                  Utils::hex2rgb("000099"),
  338.                                                  Utils::hex2rgb("0000C3"),
  339.                                                  Utils::hex2rgb("0000EE"),
  340.                                                  Utils::hex2rgb("001AFF"),
  341.                                                  Utils::hex2rgb("0046FF"),
  342.                                                  Utils::hex2rgb("0073FF"),
  343.                                                  Utils::hex2rgb("009FFF"),
  344.                                                  Utils::hex2rgb("00CBFF"),
  345.                                                  Utils::hex2rgb("00F7FF"),
  346.                                                  Utils::hex2rgb("08F4E3"),
  347.                                                  Utils::hex2rgb("11E7C3"),
  348.                                                  Utils::hex2rgb("1BDAA3"),
  349.                                                  Utils::hex2rgb("25CD83"),
  350.                                                  Utils::hex2rgb("2EC063"),
  351.                                                  Utils::hex2rgb("38B342"),
  352.                                                  Utils::hex2rgb("42A622"),
  353.                                                  Utils::hex2rgb("4B9A02"),
  354.                                                  Utils::hex2rgb("6A870C"),
  355.                                                  Utils::hex2rgb("8A751A"),
  356.                                                  Utils::hex2rgb("AA6328"),
  357.                                                  Utils::hex2rgb("CB5036"),
  358.                                                  Utils::hex2rgb("EB3E44"),
  359.                                                  Utils::hex2rgb("FF2A61"),
  360.                                                  Utils::hex2rgb("FF1596"),
  361.                                                  Utils::hex2rgb("FF00CC")
  362.                                                  );
  363.     }
  364.  
  365.     public final static function getWindowsXPPalette({
  366.         return Array(        
  367.             new Color(130,155,254),
  368.             new Color(252,209,36),
  369.             new Color(124,188,13),
  370.             new Color(253,133,47),
  371.             new Color(253,254,252),
  372.             new Color(226,78,33),
  373.             new Color(41,56,214),
  374.             new Color(183,148,0),
  375.             new Color(90,134,0),
  376.             new Color(210,70,0),
  377.             new Color(211,229,250),
  378.             new Color(216,216,216),
  379.             new Color(95,113,123)    
  380.             );
  381.     }
  382.  
  383.     public final static function getGrayscalePalette()  {
  384.       return Array(
  385.             Utils::hex2rgb("F0F0F0"),
  386.             Utils::hex2rgb("E0E0E0"),
  387.             Utils::hex2rgb("D0D0D0"),
  388.             Utils::hex2rgb("C0C0C0"),
  389.             Utils::hex2rgb("B0B0B0"),
  390.             Utils::hex2rgb("A0A0A0"),
  391.             Utils::hex2rgb("909090"),
  392.             Utils::hex2rgb("808080"),
  393.             Utils::hex2rgb("707070"),
  394.             Utils::hex2rgb("606060"),
  395.             Utils::hex2rgb("505050"),
  396.             Utils::hex2rgb("404040"),
  397.             Utils::hex2rgb("303030"),
  398.             Utils::hex2rgb("202020"),
  399.             Utils::hex2rgb("101010")
  400.             );
  401.     }
  402.  
  403.     public final static function getSkyBluesPalette()  {
  404.  
  405.         $colorArray Array();
  406.             for ($i=0;$i<15;$i++)
  407.               $colorArray[new Color(20+($i*30),255-($i*50),225-($i*8));  
  408.         
  409.         return $colorArray;
  410.     }    
  411.        
  412.     public final static function getBrightStarsPalette()  {
  413.       return Array(
  414.             Color::fromRgb(186,67,48),       
  415.             Color::fromRgb(17,113,186),       
  416.             Color::fromRgb(100,20,112),       
  417.             Color::fromRgb(214,252,58),       
  418.             Color::fromRgb(89,176,55),
  419.             Color::fromRgb(54,177,153),       
  420.             Color::fromRgb(54,75,177),       
  421.             Color::fromRgb(180,52,109),       
  422.             Color::fromRgb(140,177,54),       
  423.             Color::fromRgb(176,158,55)      
  424.             );
  425.     }
  426.        
  427. }
  428.  
  429.  
  430.     public function invoke($chart{
  431.          return null;
  432.     }
  433. }
  434. ?>

Documentation generated on Wed, 16 Jun 2010 12:08:55 +0200 by phpDocumentor 1.4.1