Added option to transcode extension and thumbnailing to choose the color to use to fill in the background when converting an image with an alpha channel to a format without

This commit is contained in:
Matthew Barbour
2020-06-14 11:36:52 -05:00
committed by Shish
parent 984c9702ec
commit 7f68ef1cfd
10 changed files with 97 additions and 28 deletions

View File

@ -278,6 +278,17 @@ class SetupBlock extends Block
$this->format_option($name, $html, $label, $table_row);
}
public function add_color_option(string $name, string $label=null, bool $table_row = false)
{
global $config;
$val = html_escape($config->get_string($name));
$html = "<input type='color' id='{$name}' name='_config_{$name}' value='{$val}'>\n";
$html .= "<input type='hidden' name='_type_{$name}' value='string'>\n";
$this->format_option($name, $html, $label, $table_row);
}
}
class Setup extends Extension