function imagecache_rgb_form in ImageCache Actions 5.2
Same name and namespace in other branches
- 8 utility-color.inc \imagecache_rgb_form()
- 5.3 utility.inc \imagecache_rgb_form()
- 6.2 utility-color.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.
3 calls to imagecache_rgb_form()
- canvasactions_definecanvas_form in ./
canvasactions.inc - Implementation of imagecache_hook_form()
- imagecache_colorshift_form in ./
imagecache_coloractions.module - Implementation of imagecache_hook_form()
- textactions_text2canvas_form in ./
textactions.inc - Place text on top of the current canvas
File
- ./
utility.inc, line 13
Code
function imagecache_rgb_form($action) {
if ($action['HEX'] && ($deduced = hex_to_rgb($action['HEX']))) {
$action = array_merge($action, $deduced);
}
$form = array(
'#theme' => 'canvasactions_rgb_form',
);
$form['red'] = array(
'#type' => 'textfield',
'#title' => t('Red'),
'#default_value' => $action['red'],
'#size' => 3,
);
$form['green'] = array(
'#type' => 'textfield',
'#title' => t('Green'),
'#default_value' => $action['green'],
'#size' => 3,
);
$form['blue'] = array(
'#type' => 'textfield',
'#title' => t('Blue'),
'#default_value' => $action['blue'],
'#size' => 3,
);
$form['HEX'] = array(
'#type' => 'textfield',
'#title' => t('HEX'),
'#default_value' => $action['HEX'],
'#size' => 7,
);
return $form;
}