diff --git a/colors.api.php b/colors.api.php
index 1fff224..4340668 100644
--- a/colors.api.php
+++ b/colors.api.php
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Hooks provided by the FullCalendar module.
+ * Hooks provided by the Colors module.
  */
 
 /**
@@ -16,7 +16,7 @@
  * @return
  *   Mapping between the colorable features and the CSS input.
  */
-function colors_colors_get_color_mapping() {
+function hook_colors_get_color_mapping() {
   return array(
     'background' => 'background-color',
     'text' =>  'color',
@@ -40,5 +40,68 @@ function hook_colors_build_selector($class) {
 }
 
 /**
+ * Declare if the CSS file should be automatically rebuilt.
+ *
+ * @return bool
+ *   TRUE if the file should be rebuilt automatically, FALSE if it should be
+ *   rebuilt at runtime.
+ */
+function hook_colors_rebuild() {
+  return TRUE;
+}
+
+/**
+ * Declare a colors plugin.
+ *
+ * @return array
+ *   An associative array containing one or more coloring types, keyed by the
+ *   type name, containing an associative array with the following keys:
+ *   - title: The untranslated display name of this type.
+ *   - short_description: The text to display for the checkbox.
+ *   - long_description: The text to describe the fieldset.
+ *   - function: The callback for gathering the type options.
+ *   - multiple_function: (optional) If the type contains sub-types, this will
+ *     be used as the top-level callback.
+ *   - validate: (optional) A boolean, if TRUE an additional form validation
+ *   - handler, colors_admin_TYPE_settings_validate(), will be used.
+ *   - submit: (optional) A boolean, if TRUE an additional form submission
+ *     handler, colors_admin_TYPE_settings_submit(), will be used.
+ */
+function hook_colors_info() {
+  return array(
+    'node_type' => array(
+      'title' => 'Node type',
+      'short_description' => t('Enable colors for node types'),
+      'long_description' => t('Colors for node types. If enabled, you may set colors for each node type below.'),
+      'function' => 'node_type_get_names',
+    ),
+  );
+}
+
+/**
+ * Add a class to be used in the CSS file.
+ *
+ * @param object $entity
+ *   The entity object.
+ * @param bool $css_only
+ *   Some modules will use this hook to add classes to their markup. If your
+ *   hook should only add to the CSS file and never to markup, return when this
+ *   is TRUE.
+ */
+function hook_colors_classes($entity, $css_only = FALSE) {
+  if ($css_only) {
+    return;
+  }
+
+  $class_names = array();
+  if (variable_get('colors_node_type_enabled', FALSE)) {
+    if ($entity->entity_type == 'node') {
+      $class_names[] = 'colors-node-type-' . $entity->type;
+    }
+  }
+  return $class_names;
+}
+
+/**
  * @} End of "addtogroup hooks".
  */
diff --git a/colors.info b/colors.info
index 45679c8..28fd49f 100644
--- a/colors.info
+++ b/colors.info
@@ -1,3 +1,4 @@
 name = Colors
 description = API for coloring selectors.
 core = 7.x
+configure = admin/config/user-interface/colors
diff --git a/colors.install b/colors.install
index e4dd3db..b6d6671 100644
--- a/colors.install
+++ b/colors.install
@@ -6,6 +6,28 @@
  */
 
 /**
+ * Implements hook_install().
+ */
+function colors_install() {
+  $color_options = array(
+    'background' => '#3366cc',
+    'border' => '#3366cc',
+    'text' => '#ffffff',
+  );
+  colors_set_colors('colors_default', $color_options);
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function colors_uninstall() {
+  db_delete('variable')
+    ->condition('name', db_like('colors_') . '%', 'LIKE')
+    ->execute();
+  cache_clear_all('variables', 'cache_bootstrap');
+}
+
+/**
  * Implements hook_schema().
  */
 function colors_schema() {
diff --git a/colors.module b/colors.module
index 9fe900d..8ff9521 100644
--- a/colors.module
+++ b/colors.module
@@ -6,6 +6,107 @@
  */
 
 /**
+ * Implements hook_menu().
+ */
+function colors_menu() {
+  $items = array();
+
+  $base = array(
+    'file' => 'colors.admin.inc',
+    'file path' => drupal_get_path('module', 'colors') . '/includes',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('colors_admin_settings'),
+    'access arguments' => array('administer site configuration'),
+  );
+
+  $items['admin/config/user-interface/colors'] = array(
+    'title' => 'Colors',
+    'description' => 'Adjust Colors settings.',
+    'type' => MENU_NORMAL_ITEM,
+  ) + $base;
+
+  $items['admin/config/user-interface/colors/settings'] = array(
+    'title' => 'Settings',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -10,
+  ) + $base;
+
+  // Create a local task for each plugin.
+  colors_include_api();
+  foreach (module_invoke_all('colors_info') as $type => $info) {
+    $items["admin/config/user-interface/colors/$type"] = array(
+      'title' => $info['title'],
+      'page arguments' => array('colors_generate_settings_form', $type),
+      'type' => MENU_LOCAL_TASK,
+    ) + $base;
+  }
+
+  return $items;
+}
+
+/**
+ * Implements hook_theme().
+ */
+function colors_theme() {
+  return array(
+    'colors_admin_settings' => array(
+      'render element' => 'form',
+      'file' => 'includes/colors.admin.inc',
+    ),
+  );
+}
+
+/**
+ * Implements hook_help().
+ */
+function colors_help($path, $arg) {
+  switch ($path) {
+    case 'admin/help#colors':
+      return '<p>' . t('You can configure colors for your events based on taxonomy terms, node types, etc. on the <a href="@link">Colors administration page</a>.', array('@link' => '/admin/config/user-interface/colors')) . '</p>';
+      break;
+  }
+}
+
+/**
+ * Includes all Colors API plugins.
+ */
+function colors_include_api() {
+  ctools_include('plugins');
+  return ctools_plugin_api_include('colors', 'colors', colors_api_version(), colors_api_minimum_version());
+}
+
+/**
+ * Implements hook_ctools_plugin_api_hook_name().
+ */
+function colors_ctools_plugin_api_hook_name() {
+  return 'colors_api';
+}
+
+/**
+ * Implements hook_colors_api().
+ */
+function colors_colors_api() {
+  return array(
+    'api' => colors_api_version(),
+    'path' => drupal_get_path('module', 'colors') . '/includes',
+  );
+}
+
+/**
+ * Declares the current Colors API version.
+ */
+function colors_api_version() {
+  return '1';
+}
+
+/**
+ * Declares the minimum Colors API version.
+ */
+function colors_api_minimum_version() {
+  return '1';
+}
+
+/**
  * Gets an array of all the selectors.
  *
  * @return
@@ -172,6 +273,41 @@ function colors_colors_get_color_mapping() {
 }
 
 /**
+ * Retrieves or generates a CSS file with a given module's selector.
+ *
+ * @param string $caller
+ *   A module that implements hook_colors_build_selector().
+ *
+ * @return string
+ *   The filename of the generated CSS.
+ */
+function colors_create_css($caller) {
+  ctools_include('css');
+  $filename = ctools_css_retrieve($caller . ':colors');
+  if (!$filename) {
+    colors_include_api();
+    $css = array();
+    $delta = 0;
+    foreach (module_invoke_all('colors_info') as $module => $info) {
+      if (!variable_get('colors_' . $module . '_enabled', FALSE)) {
+        continue;
+      }
+      $weight = variable_get('colors_weight_' . $module, $delta - 100);
+      if (!isset($css[$weight])) {
+        $css[$weight] = '';
+      }
+      foreach (colors_get_module_colors($module) as $selector => $colors) {
+        $css[$weight] .= colors_build_css($selector, $colors, $caller);
+      }
+      $delta++;
+    }
+    ksort($css);
+    $filename = ctools_css_store($caller . ':colors', implode("\n", $css));
+  }
+  return $filename;
+}
+
+/**
  * Inserts CSS from a specific module.
  *
  * @param $module
@@ -227,7 +363,7 @@ function colors_build_css($selector, $colors, $module = 'colors', $default_color
   }
 
   // Rewrite the selector if needed
-  $css = colors_invoke($module, 'colors_build_selector', $selector);
+  $css = colors_invoke($module, 'colors_build_selector', drupal_html_class($selector));
   $css .= ' {';
   foreach ($colors as $option => $color) {
     $css .= $color_mapping[$option] . ': ' . $color . ';';
@@ -287,3 +423,55 @@ function colors_invoke($module, $hook) {
   }
   return call_user_func_array('module_invoke', $args);
 }
+
+/**
+ * Removes the generated CSS file, optionally recreating it.
+ */
+function colors_css_clear() {
+  ctools_include('css');
+  foreach (module_implements('colors_rebuild') as $module) {
+    ctools_css_clear($module . ':colors');
+    if (module_invoke($module, 'colors_rebuild')) {
+      colors_create_css($module);
+    }
+  }
+}
+
+/**
+ * Wrapper function for colors_set_colors()
+ *
+ * @todo Remove when border and color are exposed.
+ */
+function _colors_set_colors($classes, $module = 'colors', $background = '#000000', $border = '#000000', $text = '#ffffff') {
+  $border = $background;
+  $colors = array(
+    'background' => $background,
+    'border' => $border,
+    'text' => $text,
+  );
+  colors_set_colors($classes, $colors, $module);
+}
+
+if (module_exists('node') && !function_exists('node_colors_api')) {
+  function node_colors_api() {
+    return colors_colors_api();
+  }
+}
+
+if (module_exists('user') && !function_exists('user_colors_api')) {
+  function user_colors_api() {
+    return colors_colors_api();
+  }
+}
+
+if (module_exists('taxonomy') && !function_exists('taxonomy_colors_api')) {
+  function taxonomy_colors_api() {
+    return colors_colors_api();
+  }
+}
+
+if (module_exists('og') && !function_exists('og_colors_api')) {
+  function og_colors_api() {
+    return colors_colors_api();
+  }
+}
diff --git a/css/colors.admin.css b/css/colors.admin.css
new file mode 100644
index 0000000..f81bc64
--- /dev/null
+++ b/css/colors.admin.css
@@ -0,0 +1,18 @@
+/**
+ * @file
+ * Styles for FullCalendar Colors admin page.
+ */
+
+.fieldset-wrapper {
+  overflow: auto;
+}
+
+.fieldset-wrapper .form-item {
+  display: block;
+  float: left;
+  width: 33%;
+}
+
+.fieldset-wrapper .form-type-checkbox {
+  width: 100%;
+}
diff --git a/includes/colors.admin.inc b/includes/colors.admin.inc
new file mode 100644
index 0000000..95423f9
--- /dev/null
+++ b/includes/colors.admin.inc
@@ -0,0 +1,272 @@
+<?php
+
+/**
+ * @file
+ * Color page callbacks for the Colors module.
+ */
+
+/**
+ * Form constructor for the Colors admin form.
+ */
+function colors_admin_settings() {
+  $form = colors_load_colorpicker();
+  $default_colors = colors_get_colors('colors_default');
+
+  $form['default_color'] = array(
+    '#type' => 'item',
+    '#title' => t('Default color'),
+    '#tree' => TRUE,
+    'input' => array(
+      '#title' => t('default color'),
+      '#type' => 'textfield',
+      '#attributes' => array('class' => array('colorpicker-input')),
+      '#default_value' => $default_colors['background'],
+      '#size' => 7,
+      '#maxlength' => 7,
+      '#title_display' => 'invisible',
+    ),
+  );
+
+  $form['process_order'] = array(
+    '#tree' => TRUE,
+    'info' => array(
+      '#type' => 'item',
+      '#title' => t('Process order'),
+    ),
+    'enabled' => array(
+      '#type' => 'checkbox',
+      '#title' => t('Change the CSS processing order.'),
+      '#default_value' => variable_get('colors_process_order_enabled', FALSE),
+      '#description' => t('Color order is cascading, CSS from modules at the bottom will override the top.'),
+    ),
+  );
+
+  colors_include_api();
+  $form['modules'] = array(
+    '#tree' => TRUE,
+  );
+  $delta = 0;
+  foreach (module_invoke_all('colors_info') as $module => $info) {
+    if (!variable_get("colors_$module" . '_enabled', FALSE)) {
+      continue;
+    }
+    $weight = variable_get('colors_weight_' . $module, $delta);
+    $form['modules'][$module]['#name'] = $info['title'];
+    $form['modules'][$module]['#weight'] = $weight;
+    $form['modules'][$module]['weight'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Weight for @title', array('@title' => $info['title'])),
+      '#title_display' => 'invisible',
+      '#size' => 4,
+      '#default_value' => $weight,
+      '#attributes' => array('class' => array('colors-weight')),
+    );
+    $delta++;
+  }
+  uasort($form['modules'], 'element_sort');
+
+  $form['order_settings'] = array(
+    '#type' => 'container',
+    '#states' => array(
+      'visible' => array(
+        'input[name="process_order[enabled]"]' => array('checked' => TRUE),
+      ),
+    ),
+  );
+
+  $form['actions'] = array(
+    '#type' => 'actions',
+    'submit' => array(
+      '#type' => 'submit',
+      '#value' => t('Save settings'),
+      '#submit' => array('colors_admin_settings_submit'),
+    ),
+  );
+
+  return $form;
+}
+
+/**
+ * Form submission handler for colors_admin_settings().
+ */
+function colors_admin_settings_submit($form, &$form_state) {
+  _colors_set_colors('colors_default', 'colors', $form_state['values']['default_color']['input']);
+  variable_set('colors_process_order_enabled', $form_state['values']['process_order']['enabled']);
+
+  foreach ($form_state['values']['modules'] as $module => $weight) {
+    variable_set('colors_weight_' . $module, $weight['weight']);
+  }
+
+  colors_css_clear();
+}
+
+/**
+ * Returns HTML for the settings form.
+ *
+ * @param array $variables
+ *   An associative array containing:
+ *   - form: A render element representing the form.
+ */
+function theme_colors_admin_settings($variables) {
+  $form = $variables['form'];
+
+  $rows = array();
+  foreach (element_children($form['modules']) as $module) {
+    $row = array();
+    $row[] = $form['modules'][$module]['#name'];
+    $row[] = drupal_render($form['modules'][$module]['weight']);
+
+    $rows[] = array('data' => $row, 'class' => array('draggable'));
+  }
+
+  $form['order_settings']['table'] = array(
+    '#theme' => 'table',
+    '#header' => array(
+      t('Module'),
+      t('Weight'),
+    ),
+    '#rows' => $rows,
+    '#attributes' => array('id' => 'colors-settings'),
+  );
+  drupal_add_tabledrag('colors-settings', 'order', 'sibling', 'colors-weight');
+
+  return drupal_render_children($form);
+}
+
+/**
+ * Generate an admin form for each Colors plugin.
+ *
+ * @param array $form
+ *   An empty array for the form, this is always overridden.
+ * @param array $form_state
+ *   The form's state.
+ * @param string $type
+ *   The machine name of the plugin type.
+ *
+ * @return array
+ *   The built form.
+ */
+function colors_generate_settings_form($form, $form_state, $type) {
+  colors_include_api();
+  $info = module_invoke_all('colors_info');
+  if (empty($info[$type])) {
+    return;
+  }
+
+  $info = $info[$type];
+
+  $form = colors_load_colorpicker();
+  $form['#attached']['css'][] = ctools_attach_css('colors.admin', 'colors');
+  $form['#colors_type'] = $type;
+  $form['#colors_info'] = $info;
+
+
+  $form[$type . '_colors'] = array(
+    '#type' => 'item',
+    '#title' => t('!title colors', array('!title' => $info['title'])),
+    '#description' => $info['long_description'],
+  );
+
+  $multiple = !empty($info['multiple_function']);
+  $repeat = !empty($multiple) ? $info['multiple_function']() : array(NULL => NULL);
+
+  foreach ($repeat as $id => $repeat_value) {
+    $enabled_type = !empty($multiple) ? $type . '_' . $id : $type;
+    $enabled_string = 'colors_' . $enabled_type . '_enabled';
+    $enabled = variable_get($enabled_string, FALSE);
+
+    $element = array(
+      '#type' => 'fieldset',
+      '#title' => !empty($multiple) ? $repeat_value->name : t('!title colors', array('!title' => $info['title'])),
+      '#collapsible' => TRUE,
+      '#collapsed' => !$enabled,
+    );
+    $element[$enabled_string] = array(
+      '#type' => 'checkbox',
+      '#title' => $info['short_description'],
+      '#default_value' => $enabled,
+    );
+    foreach ($info['function']($id) as $key => $value) {
+      $class = 'colors_' . $type . '_' . $key;
+      $colors = colors_get_colors($class, 'colors');
+
+      $element[$class] = array(
+        '#title' => t($value),
+        '#type' => 'textfield',
+        '#attributes' => array('class' => array('colorpicker-input')),
+        '#default_value' => $colors['background'],
+        '#size' => 7,
+        '#maxlength' => 7,
+        '#states' => array(
+          'visible' => array(
+            ':input[name="' . $enabled_string . '"]' => array('checked' => TRUE),
+          ),
+        ),
+      );
+    }
+    if (!empty($multiple)) {
+      $form[$id] = $element;
+    }
+    else {
+      $form['fieldset'] = $element;
+    }
+  }
+
+  $form['actions']['#type'] = 'actions';
+  $form['actions']['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save configuration'),
+  );
+  $form['#submit'][] = 'colors_admin_type_settings_submit';
+
+  // Add the additional submission handler, if necessary.
+  if (!empty($info['submit'])) {
+    $form['#submit'][] = 'colors_admin_' . $type . '_settings_submit';
+  }
+
+  // Add the additional validation handler, if necessary.
+  if (!empty($info['validate'])) {
+    $form['#validate'][] = 'colors_admin_' . $type . '_settings_validate';
+  }
+
+  return $form;
+}
+
+/**
+ * Form submission handler for colors_generate_settings_form().
+ */
+function colors_admin_type_settings_submit($form, &$form_state) {
+  if (empty($form['#colors_type']) || empty($form['#colors_info'])) {
+    return;
+  }
+
+  $type = $form['#colors_type'];
+  $info = $form['#colors_info'];
+
+  $multiple = !empty($info['multiple_function']);
+  $repeat = !empty($multiple) ? $info['multiple_function']() : array(NULL => NULL);
+
+  $multiple_enabled = FALSE;
+  foreach ($repeat as $id => $repeat_value) {
+    $enabled_type = !empty($multiple) ? $type . '_' . $id : $type;
+    $enabled_string = 'colors_' . $enabled_type . '_enabled';
+
+    variable_set($enabled_string, (bool) $form_state['values'][$enabled_string]);
+    if (!empty($form_state['values'][$enabled_string])) {
+      $multiple_enabled = TRUE;
+    }
+
+    foreach ($info['function']($id) as $key => $value) {
+      $class = 'colors_' . $type . '_' . $key;
+      _colors_set_colors($class, $type, $form_state['values'][$class]);
+    }
+  }
+
+  if ($multiple && $multiple_enabled) {
+    variable_set('colors_' . $type . '_enabled', TRUE);
+  }
+
+  colors_css_clear();
+
+  drupal_set_message(t('The configuration options have been saved.'));
+}
diff --git a/includes/node.colors.inc b/includes/node.colors.inc
new file mode 100644
index 0000000..fa0ff87
--- /dev/null
+++ b/includes/node.colors.inc
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Provides Color integration on behalf of node.module.
+ */
+
+/**
+ * Implements hook_colors_info().
+ */
+function node_colors_info() {
+  return array(
+    'node_type' => array(
+      'title' => 'Node type',
+      'short_description' => t('Enable colors for node types'),
+      'long_description' => t('Colors for node types. If enabled, you may set colors for each node type below.'),
+      'function' => 'node_type_get_names',
+    ),
+  );
+}
+
+/**
+ * Implements hook_colors_classes().
+ *
+ * Provide colors per node type.
+ */
+function node_colors_classes($entity, $css_only = FALSE) {
+  $class_names = array();
+  if (variable_get('colors_node_type_enabled', FALSE)) {
+    if ($entity->entity_type == 'node') {
+      $class_names[] = 'colors-node-type-' . $entity->type;
+    }
+  }
+  return $class_names;
+}
diff --git a/includes/og.colors.inc b/includes/og.colors.inc
new file mode 100644
index 0000000..6f42db9
--- /dev/null
+++ b/includes/og.colors.inc
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * Provides Color integration on behalf of og.module.
+ */
+
+/**
+ * Implements hook_colors_info().
+ */
+function og_colors_info() {
+  return array(
+    'og' => array(
+      'title' => 'Organic groups',
+      'short_description' => t('Enable colors for organic groups'),
+      'long_description' => t('Colors for organic groups. If enabled, you may set colors for each node type below.'),
+      'function' => '_colors_og_callback',
+    ),
+  );
+}
+
+/**
+ * Wrapper around og_get_all_group() and og_label().
+ *
+ * @return array
+ *   An array keyed by group ID, containing the group label.
+ */
+function _colors_og_callback() {
+  $gids = array();
+  foreach (og_get_all_group() as $gid) {
+    $gids[$gid] = og_label($gid);
+  }
+  return $gids;
+}
+
+/**
+ * Implements hook_colors_classes().
+ *
+ * Provide colors per og type.
+ */
+function og_colors_classes($entity, $css_only = FALSE) {
+  $class_names = array();
+  if (variable_get('colors_og_enabled', FALSE)) {
+    list($id) = entity_extract_ids($entity->entity_type, $entity);
+    if (!empty($id)) {
+      foreach (og_get_entity_groups($entity->entity_type, $entity) as $gid) {
+        $class_names[] = 'colors_og' . $gid;
+      }
+    }
+  }
+  return $class_names;
+}
diff --git a/includes/taxonomy.colors.inc b/includes/taxonomy.colors.inc
new file mode 100644
index 0000000..068add0
--- /dev/null
+++ b/includes/taxonomy.colors.inc
@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * @file
+ * Provides Color integration on behalf of taxonomy.module.
+ */
+
+/**
+ * Implements hook_colors_info().
+ */
+function taxonomy_colors_info() {
+  return array(
+    'taxonomy_term' => array(
+      'title' => 'Taxonomy term',
+      'short_description' => t('Enable this vocabulary'),
+      'long_description' => t('Colors on a per-taxonomy basis. After enabling a vocabulary, you can set colors for individual taxonomy terms below.'),
+      'function' => '_colors_taxonomy_term_callback',
+      'multiple_function' => 'taxonomy_get_vocabularies',
+    ),
+  );
+}
+
+/**
+ * Wrapper around taxonomy_get_tree().
+ *
+ * @param int $vid
+ *   The vocabulary ID.
+ *
+ * @return array
+ *  An array keyed by term ID, containing the term name.
+ */
+function _colors_taxonomy_term_callback($vid) {
+  $terms = array();
+  foreach (taxonomy_get_tree($vid) as $term) {
+    $terms[$term->tid] = $term->name;
+  }
+  return $terms;
+}
+
+/**
+ * Implements hook_colors_classes().
+ */
+function taxonomy_colors_classes($entity, $css_only = FALSE) {
+  if (!variable_get('colors_taxonomy_term_enabled', FALSE)) {
+    return array();
+  }
+
+  $filtered_entity = array_intersect_key((array) $entity, field_info_instances($entity->entity_type, $entity->bundle));
+  $tids = array();
+  foreach ($filtered_entity as $key => $value) {
+    foreach ($value as $language => $term) {
+      foreach ($term as $content) {
+        if (isset($content['tid'])) {
+          $tids[] = $content['tid'];
+        }
+      }
+    }
+  }
+
+  $class_names = array();
+  foreach (taxonomy_get_vocabularies() as $vid => $vocab) {
+    if (variable_get('colors_taxonomy_term_' . $vid . '_enabled', FALSE)) {
+      // If enabled, get all the terms in the taxonomy.
+      foreach (taxonomy_get_tree($vid) as $term) {
+        if (in_array($term->tid, $tids)) {
+          $class_names[] = 'colors-taxonomy-term-' . $term->tid;
+        }
+      }
+    }
+  }
+  return $class_names;
+}
diff --git a/includes/user.colors.inc b/includes/user.colors.inc
new file mode 100644
index 0000000..b061c9f
--- /dev/null
+++ b/includes/user.colors.inc
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Provides Color integration on behalf of user.module.
+ */
+
+/**
+ * Implements hook_colors_info().
+ */
+function user_colors_info() {
+  return array(
+    'user_role' => array(
+      'title' => 'User role',
+      'short_description' => t('Enable colors for user role'),
+      'long_description' => t('Colors for user roles. If enabled, you may set colors for each user role below.'),
+      'function' => 'user_roles',
+    ),
+  );
+}
+
+/**
+ * Implements hook_colors_classes().
+ *
+ * Provide colors per user role.
+ */
+function user_colors_classes($entity, $css_only = FALSE) {
+  $class_names = array();
+  if (variable_get('colors_user_role_enabled', FALSE)) {
+    if ($entity->entity_type == 'user' && !empty($entity->roles)) {
+      foreach ($entity->roles as $role_id => $role) {
+        $class_names[] = 'colors-user-role-' . $role_id;
+      }
+    }
+  }
+  return $class_names;
+}
