You are here

function site_banner_get_text_color_code in Site Banner 7

Searches the form response to determine the text color to be saved.

Parameters

int $position_in_color_array: the form_sate object containing user settings

string $custom_color_code: a HTML hex color code denoting selected custom color

bool $is_custom_color: whether a custom color is being used or not.

Return value

string the background color as HTML hex color code

2 calls to site_banner_get_text_color_code()
SiteBannerContextReactionChangeBannerTextColor::options_form_submit in ./site_banner_context_reaction_functions.inc
Submit handler for context-specific site banner text color settings.
site_banner_get_text_color_from_form in ./site_banner.admin.inc
Searches the form response to determine the text color to be saved.

File

./site_banner.module, line 285
Main module file implementing callbacks for the site banner module.

Code

function site_banner_get_text_color_code($position_in_color_array, $custom_color_code, $is_custom_color = TRUE) {
  $text_color_code = '#000000';
  if ($is_custom_color) {
    $text_color_code = $custom_color_code;
  }
  else {
    $text_colors = array_keys(site_banner_get_text_colors());
    $text_color_code = $text_colors[$position_in_color_array];
  }
  return $text_color_code;
}