Same name and namespace in other branches
  1. 7.x-1.x color_field.module \color_field_field_info() 1 comment

Implements hook_field_info().

File

./color_field.field.inc, line 11

Code

function color_field_field_info() {
    return array(
        'color_field_rgb' => array(
            'label' => t('Color Field'),
            'description' => t('Field using a hexadecimal notation.'),
            // These settings apply to the color field field everywhere it is used.
'settings' => array(
                'opacity' => FALSE,
            ),
            // These settings apply to the color field instance.
'instance_settings' => array(
                // Simple widget.
'default_colors' => '
#AC725E,#D06B64,#F83A22,#FA573C,#FF7537,#FFAD46
#42D692,#16A765,#7BD148,#B3DC6C,#FBE983
#92E1C0,#9FE1E7,#9FC6E7,#4986E7,#9A9CFF
#B99AFF,#C2C2C2,#CABDBF,#CCA6AC,#F691B2
#CD74E6,#A47AE2',
                // Simple color.
'cell_width' => 10,
                'cell_height' => 10,
                'cell_margin' => 1,
                'box_width' => 115,
                'box_height' => 20,
                'columns' => 16,
                // Spectrum.
'show_input' => FALSE,
                'show_palette' => FALSE,
                'palette' => '',
                'show_palette_only' => TRUE,
                'show_buttons' => FALSE,
                'allow_empty' => FALSE,
            ),
            'default_widget' => 'color_field_default_widget',
            'default_formatter' => 'color_field_default_formatter',
            // Support hook_entity_property_info() from contrib "Entity API".
'property_type' => 'color_field',
            'property_callbacks' => array(
                'color_field_property_info_callback',
            ),
        ),
    );
}