You are here

function _spaces_design_validate_color in Spaces 6.2

Helper function that tests whether a given color string is valid. Currently doesn't do a particulaly hard check.

1 call to _spaces_design_validate_color()
space_setting_color::submit in spaces_design/spaces_design.spaces.inc

File

spaces_design/spaces_design.module, line 135

Code

function _spaces_design_validate_color($color) {
  $color = trim($color);

  // Find all colors in the stylesheet and the chunks in between.
  // $style = preg_split('/(#[0-9a-f]{6}|#[0-9a-f]{3})/i', $style, -1, PREG_SPLIT_DELIM_CAPTURE);
  if (strlen($color) == 7) {
    return TRUE;
  }
  return FALSE;
}