public function getColor($model) { $width = isset($model['css']['width']) ? $model['css']['width'] : $this->getWidth($model); foreach ($this->panel->colors as $percent => $color) { if ($width >= $percent) { return $color; } } return '#d6e685'; }