You are here

function imagecache_alpha_form in ImageCache Actions 5.2

Same name and namespace in other branches
  1. 5.3 transparency.inc \imagecache_alpha_form()
  2. 6.2 coloractions/transparency.inc \imagecache_alpha_form()
  3. 6 transparency.inc \imagecache_alpha_form()

Implementation of imagecache_hook_form()

Settings for alpha actions.

Parameters

$action array of settings for this action:

Return value

a form definition

File

./transparency.inc, line 17

Code

function imagecache_alpha_form($action) {
  $form = array();
  $form['description'] = array(
    '#value' => t("<p>Alpha toning is an advanced method of greyscaling or colorizing. \n      It works using transparency, not colour matching. \n      The results of this filter are excellent for using as watermarks, \n      and for 'sepia' type imprints on coloured or textured backgrounds. \n      It converts dark areas of the image to opaque, light to transparent.</p> \n      <p>Note that if you are working with JPEGs, this alpha effect will not last into the final image \n      <em>unless</em> you either <strong>flatten</strong> this image against a background color \n      or image in a later process or <strong>convert</strong> it to a PNG before saving \n      using available imagecache actions.</p>"),
  );
  $form['color'] = array(
    '#type' => 'textfield',
    '#title' => t('Fill Color'),
    '#default_value' => $action['color'] ? $action['color'] : "#000000",
    '#size' => 10,
    '#description' => t("Although this image will end up as an alpha transparency mask, it still has to have some colour to be visible. Black is safe. Dark Sepia #704214 is good too. If it's not set, the colors will be left as they were, but will unsaturate unevenly."),
  );
  $form['flatten'] = array(
    '#type' => 'checkbox',
    '#title' => t('Flatten Transparency'),
    '#default_value' => $action['flatten'],
    '#return_value' => TRUE,
    '#description' => t("The opposite of adding alpha transparency, 'flatten' will place the given colour solidly behind the image. Use this if you can't trust IE, or you really do want the image filled in with a solid colour."),
  );
  return $form;
}