File

src/Plugin/Field/FieldType/ColorFieldItem.php, line 32

Class

ColorFieldItem
Plugin implementation of the 'color_field' field type.

Namespace

Drupal\color_field\Plugin\Field\FieldType

Code

public static function schema(FieldStorageDefinitionInterface $field_definition) {
    return array(
        'columns' => array(
            'color' => array(
                'description' => 'The RGB hex values',
                'type' => 'varchar',
                'length' => 7,
                'not null' => FALSE,
            ),
            'opacity' => array(
                'description' => 'The opacity/alphavalue property',
                'type' => 'float',
                'size' => 'tiny',
                'not null' => FALSE,
            ),
        ),
        'indexes' => array(
            'color' => array(
                'color',
            ),
        ),
    );
}