This module extends the Forms API by adding a "color_picker" type field for use in custom forms. The element allows you to specify a list of hex colors that the user can choose from and the selection is stored as the field value.
It's usage is as follows:
$form['bg_colour'] = [
'#type' => 'color_picker',
'#title' => t('Background Color'),
'#description' => t('Select the background color.'),
'#default_value' => '#000000',
'#color_values' => '#000000,#ff0000,#00ff00,#0000ff,#ffffff',
];
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Color ecosystem
Most installed first