yii\debug\components\TimelineDataProvider::getColor PHP Метод

getColor() публичный Метод

Getting HEX color based on model duration
public getColor ( array $model ) : string
$model array
Результат string
    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';
    }