You are here

function site_banner_get_existing_text_color in Site Banner 7

Returns the existing text color if defined.

Parameters

array $context: the context array with settings storing text color if previously saved.

Return value

string the HTML hexadecimal color code

2 calls to site_banner_get_existing_text_color()
SiteBannerContextReactionChangeBannerTextColor::execute in ./site_banner_context_reaction_functions.inc
Output banner text colour for active contexts.
SiteBannerContextReactionChangeBannerTextColor::options_form in ./site_banner_context_reaction_functions.inc
Administration panel for setting banner text color for selected contexts.

File

./site_banner_context_reaction_functions.inc, line 254

Code

function site_banner_get_existing_text_color($context) {
  if (!empty($context->reactions['change_banner_text_color'])) {
    return $context->reactions['change_banner_text_color'];
  }
  else {

    // Get first element in text color array.
    $colors = array_keys(site_banner_get_text_colors());
    return $colors[0];
  }
}