function imagecache_rgb_form in ImageCache Actions 6.2
Same name and namespace in other branches
- 8 utility-color.inc \imagecache_rgb_form()
- 5.3 utility.inc \imagecache_rgb_form()
- 5.2 utility.inc \imagecache_rgb_form()
- 6 utility.inc \imagecache_rgb_form()
- 7 utility-color.inc \imagecache_rgb_form()
Prepare a subform for displaying RGB fields
Helper function to render a common element.
Note that any module that re-uses this form also has to declare the theme function in order to ensure it's in the registry.
4 calls to imagecache_rgb_form()
- canvasactions_definecanvas_form in canvasactions/
canvasactions.inc - Implementation of imagecache_hook_form()
- imagecache_alpha_form in coloractions/
transparency.inc - Implementation of imagecache_hook_form()
- imagecache_coloroverlay_form in coloractions/
imagecache_coloractions.module - Implementation of imagecache_hook_form()
- imagecache_colorshift_form in coloractions/
imagecache_coloractions.module - Implementation of imagecache_hook_form()
File
- ./
utility-color.inc, line 14 - Utility functions for color widgets
Code
function imagecache_rgb_form($action) {
if ($action['HEX'] && ($deduced = hex_to_rgb($action['HEX']))) {
$action = array_merge($action, $deduced);
$action['HEX'] = ltrim($action['HEX'], '#');
// With or without # is valid, but trim for consistancy
}
$form = array(
'#theme' => 'imagecacheactions_rgb_form',
);
$form['farb'] = array(
'#weight' => -1,
);
// Placeholder to get its weight right
$form['HEX'] = array(
'#type' => 'textfield',
'#title' => t('HEX'),
'#default_value' => $action['HEX'],
'#size' => 7,
);
return $form;
}