You are here

function _lightbox2_validate_hex_color in Lightbox2 5.2

Same name and namespace in other branches
  1. 8 lightbox2.admin.inc \_lightbox2_validate_hex_color()
  2. 6 lightbox2.admin.inc \_lightbox2_validate_hex_color()
  3. 7.2 lightbox2.admin.inc \_lightbox2_validate_hex_color()
  4. 7 lightbox2.admin.inc \_lightbox2_validate_hex_color()

Validate a hex color value.

Parameters

$hex: The hex color string to validate.

Return value

TRUE if $hex is a valid hex color value.

1 call to _lightbox2_validate_hex_color()
lightbox2_general_settings_form_validate in ./lightbox2.module
Validation function for the general configuration form.

File

./lightbox2.module, line 2299
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function _lightbox2_validate_hex_color($hex) {
  return preg_match('!^[a-f0-9]{3}([a-f0-9]{3})?$!i', $hex);
}