function designkit_validate_color in DesignKit 6
Same name and namespace in other branches
- 7 designkit.admin.inc \designkit_validate_color()
Element validate callback for color setting.
1 string reference to 'designkit_validate_color'
- _designkit_form_alter in ./
designkit.admin.inc - Implementation of hook_form_alter() for spaces_features_form, system_theme_settings.
File
- ./
designkit.admin.inc, line 113
Code
function designkit_validate_color($element, &$form_state) {
$color = trim($element['#value']);
if (empty($color) || $color === '#' || designkit_valid_color($color)) {
return TRUE;
}
form_set_error($element['#name'], t('Please enter a valid color or leave blank.'));
}