diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/Color.php | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/app/Model/Color.php b/app/Model/Color.php index 73e5d629..6df7beb8 100644 --- a/app/Model/Color.php +++ b/app/Model/Color.php @@ -123,6 +123,22 @@ class Color extends Base } /** + * Get color properties + * + * @access public + * @param string $color_id + * @return array + */ + public function getColorProperties($color_id) + { + if (isset($this->default_colors[$color_id])) { + return $this->default_colors[$color_id]; + } + + return $this->default_colors[$this->getDefaultColor()]; + } + + /** * Get available colors * * @access public @@ -151,6 +167,17 @@ class Color extends Base } /** + * Get the default colors + * + * @access public + * @return array + */ + public function getDefaultColors() + { + return $this->default_colors; + } + + /** * Get Bordercolor from string * * @access public @@ -159,11 +186,8 @@ class Color extends Base */ public function getBorderColor($color_id) { - if (isset($this->default_colors[$color_id])) { - return $this->default_colors[$color_id]['border']; - } - - return $this->default_colors[$this->getDefaultColor()]['border']; + $color = $this->getColorProperties($color_id); + return $color['border']; } /** @@ -175,11 +199,8 @@ class Color extends Base */ public function getBackgroundColor($color_id) { - if (isset($this->default_colors[$color_id])) { - return $this->default_colors[$color_id]['background']; - } - - return $this->default_colors[$this->getDefaultColor()]['background']; + $color = $this->getColorProperties($color_id); + return $color['background']; } /** |