• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/color/phasecolorscheme.php
  • Класс: Bitrix\Crm\Color\PhaseColorScheme
  • Вызов: PhaseColorScheme::fillDefaultColors
static function fillDefaultColors(array $stages): array
{
	$offset = -1;
	foreach($stages as &$stage)
	{
		$semantics = $stage['SEMANTICS'] ?? '';
		if(!PhaseSemantics::isFinal($semantics))
		{
			$offset++;
		}
		$color = $stage['COLOR'] ?? '';
		if(empty($color) || mb_strlen($stage['COLOR']) < 4)
		{
			$stage['COLOR'] = static::getDefaultColorBySemantics($semantics, [
				'offset' => $offset,
			]);
		}
		elseif(mb_strpos($stage['COLOR'], '#') !== 0)
		{
			$stage['COLOR'] = '#' . $stage['COLOR'];
		}
	}

	return $stages;
}