function site_banner_get_background_colors in Site Banner 7
Function defining the color code and readable name for the background color.
Including a code example for ease of configuration, not commented code
@ignore production_code $background_colors = array(
'#000000' => t('Black'),
'#ff0000' => t('Red'),
'#00ff00' => t('Green'),
'#0000ff' => t('Blue'),
'#ffffff' => t('White'),
@ignore production_code );
Always needs to map a 6 digit hexadecimal (hex) color code to a name displayed on the module's admin page.
Return value
array array mapping hex colors to readable names
5 calls to site_banner_get_background_colors()
- SiteBannerColorUnitTestCase::testBackgroundColorsAreValid in ./
site_banner.test - Tests whether all text colors pass validation.
- SiteBannerColorUnitTestCase::testBackgroundColorsExist in ./
site_banner.test - Tests whether there is at least one preset background color.
- site_banner_generate_bg_color_form_elements in ./
site_banner.admin.inc - Generates the form elements for defining background colours.
- site_banner_get_background_color_code in ./
site_banner.module - Searches the form response to determine the background color to be saved.
- site_banner_get_existing_background_color in ./
site_banner_context_reaction_functions.inc - Returns the existing background color.
File
- ./
site_banner_options.inc, line 29 - A set of configuration and customisable functions for the site banner module.
Code
function site_banner_get_background_colors() {
$background_colors = array(
'#000000' => t('Black'),
'#ff0000' => t('Red'),
'#00ff00' => t('Green'),
'#0000ff' => t('Blue'),
'#ffffff' => t('White'),
);
return $background_colors;
}