.. include:: /Includes.rst.txt .. _columns-input-renderType-colorpicker: .. _columns-color: ===== Color ===== .. versionadded:: 12.0 The TCA type :php:`color` has been introduced. It replaces the :php:`renderType=colorpicker` of TCA type :php:`input`. .. versionadded:: 13.0 When using the `color` type, TYPO3 takes care of :ref:`generating the according database field `. A developer does not need to define this field in an extension's :file:`ext_tables.sql` file. The TCA type :php:`color` should be used to render a JavaScript-based color picker. .. versionadded:: 13.0 :ref:`Color palettes ` can be defined via :ref:`page TSconfig `. This way, for example, colors defined in a corporate design can be selected by a simple click. Examples ======== A simple color picker: .. code-block:: php 'a_color_field' => [ 'label' => 'Color field', 'config' => [ 'type' => 'color', ] ] Migration ========= A complete migration from :php:`renderType=colorpicker` to :php:`type=color` looks like the following: .. code-block:: php // Before 'a_color_field' => [ 'label' => 'Color field', 'config' => [ 'type' => 'input', 'renderType' => 'colorpicker', 'required' => true, 'size' => 20, 'max' => 1024, 'eval' => 'trim', 'valuePicker' => [ 'items' => [ ['typo3 orange', '#FF8700'], ], ], ], ], // After 'a_color_field' => [ 'label' => 'Color field', 'config' => [ 'type' => 'color', 'required' => true, 'size' => 20, 'valuePicker' => [ 'items' => [ ['typo3 orange', '#FF8700'], ], ], ] ] An automatic TCA migration is performed on the fly, migrating all occurrences to the new TCA type and triggering a PHP :php:`E_USER_DEPRECATED` error where code adoption has to take place. .. toctree:: :titlesonly: Properties/Index