You are here

function site_banner_get_html_color_regex_pattern in Site Banner 7

A function checking for valid color codes.

Return value

string regex expression describing a valid html color code.

4 calls to site_banner_get_html_color_regex_pattern()
SiteBannerColorUnitTestCase::testBackgroundColorsAreValid in ./site_banner.test
Tests whether all text colors pass validation.
SiteBannerColorUnitTestCase::testTextColorsAreValid in ./site_banner.test
Tests whether all preset text colors pass validation.
site_banner_validate_background_color_code_form in ./site_banner.admin.inc
Validate background color submissions in form content.
site_banner_validate_text_color_code_form in ./site_banner.admin.inc
Validate text color submissions in form content.

File

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

Code

function site_banner_get_html_color_regex_pattern() {
  return '/#([a-f]|[A-F]|[0-9]){6}\\b/';
}