当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Style_Color::_indexedColors方法代码示例

本文整理汇总了PHP中PHPExcel_Style_Color::_indexedColors方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Style_Color::_indexedColors方法的具体用法?PHP PHPExcel_Style_Color::_indexedColors怎么用?PHP PHPExcel_Style_Color::_indexedColors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Style_Color的用法示例。


在下文中一共展示了PHPExcel_Style_Color::_indexedColors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexedColor

 /**
  * Get indexed color
  * 
  * @param	int		$pIndex
  * @return	PHPExcel_Style_Color
  */
 public static function indexedColor($pIndex)
 {
     // Clean parameter
     $pIndex = intval($pIndex);
     // Indexed colors
     if (is_null(self::$_indexedColors)) {
         self::$_indexedColors = array();
         self::$_indexedColors[] = '00000000';
         self::$_indexedColors[] = '00FFFFFF';
         self::$_indexedColors[] = '00FF0000';
         self::$_indexedColors[] = '0000FF00';
         self::$_indexedColors[] = '000000FF';
         self::$_indexedColors[] = '00FFFF00';
         self::$_indexedColors[] = '00FF00FF';
         self::$_indexedColors[] = '0000FFFF';
         self::$_indexedColors[] = '00000000';
         self::$_indexedColors[] = '00FFFFFF';
         self::$_indexedColors[] = '00FF0000';
         self::$_indexedColors[] = '0000FF00';
         self::$_indexedColors[] = '000000FF';
         self::$_indexedColors[] = '00FFFF00';
         self::$_indexedColors[] = '00FF00FF';
         self::$_indexedColors[] = '0000FFFF';
         self::$_indexedColors[] = '00800000';
         self::$_indexedColors[] = '00008000';
         self::$_indexedColors[] = '00000080';
         self::$_indexedColors[] = '00808000';
         self::$_indexedColors[] = '00800080';
         self::$_indexedColors[] = '00008080';
         self::$_indexedColors[] = '00C0C0C0';
         self::$_indexedColors[] = '00808080';
         self::$_indexedColors[] = '009999FF';
         self::$_indexedColors[] = '00993366';
         self::$_indexedColors[] = '00FFFFCC';
         self::$_indexedColors[] = '00CCFFFF';
         self::$_indexedColors[] = '00660066';
         self::$_indexedColors[] = '00FF8080';
         self::$_indexedColors[] = '000066CC';
         self::$_indexedColors[] = '00CCCCFF';
         self::$_indexedColors[] = '00000080';
         self::$_indexedColors[] = '00FF00FF';
         self::$_indexedColors[] = '00FFFF00';
         self::$_indexedColors[] = '0000FFFF';
         self::$_indexedColors[] = '00800080';
         self::$_indexedColors[] = '00800000';
         self::$_indexedColors[] = '00008080';
         self::$_indexedColors[] = '000000FF';
         self::$_indexedColors[] = '0000CCFF';
         self::$_indexedColors[] = '00CCFFFF';
         self::$_indexedColors[] = '00CCFFCC';
         self::$_indexedColors[] = '00FFFF99';
         self::$_indexedColors[] = '0099CCFF';
         self::$_indexedColors[] = '00FF99CC';
         self::$_indexedColors[] = '00CC99FF';
         self::$_indexedColors[] = '00FFCC99';
         self::$_indexedColors[] = '003366FF';
         self::$_indexedColors[] = '0033CCCC';
         self::$_indexedColors[] = '0099CC00';
         self::$_indexedColors[] = '00FFCC00';
         self::$_indexedColors[] = '00FF9900';
         self::$_indexedColors[] = '00FF6600';
         self::$_indexedColors[] = '00666699';
         self::$_indexedColors[] = '00969696';
         self::$_indexedColors[] = '00003366';
         self::$_indexedColors[] = '00339966';
         self::$_indexedColors[] = '00003300';
         self::$_indexedColors[] = '00333300';
         self::$_indexedColors[] = '00993300';
         self::$_indexedColors[] = '00993366';
         self::$_indexedColors[] = '00333399';
         self::$_indexedColors[] = '00333333';
     }
     if (array_key_exists($pIndex, self::$_indexedColors)) {
         return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]);
     }
     return new PHPExcel_Style_Color();
 }
开发者ID:electromanlord,项目名称:sgd,代码行数:83,代码来源:Color.php

示例2: indexedColor

 /**
  * Get indexed color
  *
  * @param	int			$pIndex			Index entry point into the colour array
  * @param	boolean		$background		Flag to indicate whether default background or foreground colour
  *											should be returned if the indexed colour doesn't exist
  * @return	PHPExcel_Style_Color
  */
 public static function indexedColor($pIndex, $background = FALSE)
 {
     // Clean parameter
     $pIndex = intval($pIndex);
     // Indexed colors
     if (is_null(self::$_indexedColors)) {
         self::$_indexedColors = array(1 => 'FF000000', 2 => 'FFFFFFFF', 3 => 'FFFF0000', 4 => 'FF00FF00', 5 => 'FF0000FF', 6 => 'FFFFFF00', 7 => 'FFFF00FF', 8 => 'FF00FFFF', 9 => 'FF800000', 10 => 'FF008000', 11 => 'FF000080', 12 => 'FF808000', 13 => 'FF800080', 14 => 'FF008080', 15 => 'FFC0C0C0', 16 => 'FF808080', 17 => 'FF9999FF', 18 => 'FF993366', 19 => 'FFFFFFCC', 20 => 'FFCCFFFF', 21 => 'FF660066', 22 => 'FFFF8080', 23 => 'FF0066CC', 24 => 'FFCCCCFF', 25 => 'FF000080', 26 => 'FFFF00FF', 27 => 'FFFFFF00', 28 => 'FF00FFFF', 29 => 'FF800080', 30 => 'FF800000', 31 => 'FF008080', 32 => 'FF0000FF', 33 => 'FF00CCFF', 34 => 'FFCCFFFF', 35 => 'FFCCFFCC', 36 => 'FFFFFF99', 37 => 'FF99CCFF', 38 => 'FFFF99CC', 39 => 'FFCC99FF', 40 => 'FFFFCC99', 41 => 'FF3366FF', 42 => 'FF33CCCC', 43 => 'FF99CC00', 44 => 'FFFFCC00', 45 => 'FFFF9900', 46 => 'FFFF6600', 47 => 'FF666699', 48 => 'FF969696', 49 => 'FF003366', 50 => 'FF339966', 51 => 'FF003300', 52 => 'FF333300', 53 => 'FF993300', 54 => 'FF993366', 55 => 'FF333399', 56 => 'FF333333');
     }
     if (array_key_exists($pIndex, self::$_indexedColors)) {
         return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]);
     }
     if ($background) {
         return new PHPExcel_Style_Color('FFFFFFFF');
     }
     return new PHPExcel_Style_Color('FFFFFFFF');
 }
开发者ID:sirpapy,项目名称:Projet-Tuteur--LIGM,代码行数:24,代码来源:Color.php

示例3: indexedColor

    /**
     * Get indexed color
     *
     * @param int $pIndex
     *            point into the colour array
     * @param boolean $background
     *            indicate whether default background or foreground colour
     *            should be returned if the indexed colour doesn't exist
     * @return PHPExcel_Style_Color
     */
    public static function indexedColor($pIndex, $background = FALSE)
    {
        // Clean parameter
        $pIndex = intval($pIndex);
        
        // Indexed colors
        if (is_null(self::$_indexedColors)) {
            self::$_indexedColors = array(
                1 => 'FF000000', // System Colour #1 - Black
                2 => 'FFFFFFFF', // System Colour #2 - White
                3 => 'FFFF0000', // System Colour #3 - Red
                4 => 'FF00FF00', // System Colour #4 - Green
                5 => 'FF0000FF', // System Colour #5 - Blue
                6 => 'FFFFFF00', // System Colour #6 - Yellow
                7 => 'FFFF00FF', // System Colour #7- Magenta
                8 => 'FF00FFFF', // System Colour #8- Cyan
                9 => 'FF800000', // Standard Colour #9
                10 => 'FF008000', // Standard Colour #10
                11 => 'FF000080', // Standard Colour #11
                12 => 'FF808000', // Standard Colour #12
                13 => 'FF800080', // Standard Colour #13
                14 => 'FF008080', // Standard Colour #14
                15 => 'FFC0C0C0', // Standard Colour #15
                16 => 'FF808080', // Standard Colour #16
                17 => 'FF9999FF', // Chart Fill Colour #17
                18 => 'FF993366', // Chart Fill Colour #18
                19 => 'FFFFFFCC', // Chart Fill Colour #19
                20 => 'FFCCFFFF', // Chart Fill Colour #20
                21 => 'FF660066', // Chart Fill Colour #21
                22 => 'FFFF8080', // Chart Fill Colour #22
                23 => 'FF0066CC', // Chart Fill Colour #23
                24 => 'FFCCCCFF', // Chart Fill Colour #24
                25 => 'FF000080', // Chart Line Colour #25
                26 => 'FFFF00FF', // Chart Line Colour #26
                27 => 'FFFFFF00', // Chart Line Colour #27
                28 => 'FF00FFFF', // Chart Line Colour #28
                29 => 'FF800080', // Chart Line Colour #29
                30 => 'FF800000', // Chart Line Colour #30
                31 => 'FF008080', // Chart Line Colour #31
                32 => 'FF0000FF', // Chart Line Colour #32
                33 => 'FF00CCFF', // Standard Colour #33
                34 => 'FFCCFFFF', // Standard Colour #34
                35 => 'FFCCFFCC', // Standard Colour #35
                36 => 'FFFFFF99', // Standard Colour #36
                37 => 'FF99CCFF', // Standard Colour #37
                38 => 'FFFF99CC', // Standard Colour #38
                39 => 'FFCC99FF', // Standard Colour #39
                40 => 'FFFFCC99', // Standard Colour #40
                41 => 'FF3366FF', // Standard Colour #41
                42 => 'FF33CCCC', // Standard Colour #42
                43 => 'FF99CC00', // Standard Colour #43
                44 => 'FFFFCC00', // Standard Colour #44
                45 => 'FFFF9900', // Standard Colour #45
                46 => 'FFFF6600', // Standard Colour #46
                47 => 'FF666699', // Standard Colour #47
                48 => 'FF969696', // Standard Colour #48
                49 => 'FF003366', // Standard Colour #49
                50 => 'FF339966', // Standard Colour #50
                51 => 'FF003300', // Standard Colour #51
                52 => 'FF333300', // Standard Colour #52
                53 => 'FF993300', // Standard Colour #53
                54 => 'FF993366', // Standard Colour #54
                55 => 'FF333399', // Standard Colour #55
                56 => 'FF333333'
            ) // Standard Colour #56
;
        }
        
        if (array_key_exists($pIndex, self::$_indexedColors)) {
            return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]);
        }
        
        if ($background) {
            return new PHPExcel_Style_Color('FFFFFFFF');
        }
        return new PHPExcel_Style_Color('FF000000');
    }
开发者ID:nhatlang19,项目名称:elearningONL,代码行数:87,代码来源:Color.php


注:本文中的PHPExcel_Style_Color::_indexedColors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。