Theme.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. /**
  8. * PHPExcel_Reader_Excel2007_Theme
  9. *
  10. * @category PHPExcel
  11. * @package PHPExcel_Reader_Excel2007
  12. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  13. */
  14. class PHPExcel_Reader_Excel2007_Theme
  15. {
  16. /**
  17. * Theme Name
  18. *
  19. * @var string
  20. */
  21. private $themeName;
  22. /**
  23. * Colour Scheme Name
  24. *
  25. * @var string
  26. */
  27. private $colourSchemeName;
  28. /**
  29. * Colour Map indexed by position
  30. *
  31. * @var array of string
  32. */
  33. private $colourMapValues;
  34. /**
  35. * Colour Map
  36. *
  37. * @var array of string
  38. */
  39. private $colourMap;
  40. /**
  41. * Create a new PHPExcel_Theme
  42. *
  43. */
  44. public function __construct($themeName, $colourSchemeName, $colourMap)
  45. {
  46. // Initialise values
  47. $this->themeName = $themeName;
  48. $this->colourSchemeName = $colourSchemeName;
  49. $this->colourMap = $colourMap;
  50. }
  51. /**
  52. * Get Theme Name
  53. *
  54. * @return string
  55. */
  56. public function getThemeName()
  57. {
  58. return $this->themeName;
  59. }
  60. /**
  61. * Get colour Scheme Name
  62. *
  63. * @return string
  64. */
  65. public function getColourSchemeName()
  66. {
  67. return $this->colourSchemeName;
  68. }
  69. /**
  70. * Get colour Map Value by Position
  71. *
  72. * @return string
  73. */
  74. public function getColourByIndex($index = 0)
  75. {
  76. if (isset($this->colourMap[$index])) {
  77. return $this->colourMap[$index];
  78. }
  79. return null;
  80. }
  81. /**
  82. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  83. */
  84. public function __clone()
  85. {
  86. $vars = get_object_vars($this);
  87. foreach ($vars as $key => $value) {
  88. if ((is_object($value)) && ($key != '_parent')) {
  89. $this->$key = clone $value;
  90. } else {
  91. $this->$key = $value;
  92. }
  93. }
  94. }
  95. }