You are here

function field_collection_colors_classes in Colors 7

Implements hook_colors_classes().

Reuse the colors of the field collection item's host entity.

File

includes/field_collection.colors.inc, line 13
Provides Colors integration on behalf of Field collection.

Code

function field_collection_colors_classes($entity) {
  $classes = array();
  if ($entity->entity_type == 'field_collection_item') {
    $host_entity = $entity
      ->hostEntity();
    $host_entity->entity_type = $entity
      ->hostEntityType();
    $classes = module_invoke($host_entity->entity_type, 'colors_classes', $host_entity);
  }
  return $classes;
}