Download the PHP package codein/ez-color-picker without Composer
On this page you can find all versions of the php package codein/ez-color-picker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codein/ez-color-picker
More information about codein/ez-color-picker
Files in codein/ez-color-picker
Package ez-color-picker
Short Description eZplatform color picker field type
License MIT
Informations about the package ez-color-picker
Codein eZColorPicker
Symfony bundle that adds color management to eZ Platform.
Note : this is the compatibility branch for eZ Platform 2.5 (ezsystems/ezpublish-kernel:7.5). For a Ibexa Platform compatible version, please check this repository instead : https://github.com/Codein-Labs/ibexa-color-picker
Installation
Activate the bundle in AppKernel.php
Compile the assets for the admin UI
Usage
Default value
You can set a default color for your field. The default color will be proposed to the user if no color is already set. If the field is required, the default color is assigned as default. If not, no color is assigned.
Twig
The default color format rendered in Twig is RGBa. You can pass extra options to ez_render_field.
- format: RGBa, HEXa, HSVa, RGB, HEX
- default: default value returned if field is empty. If not set ez_render_field will return an empty string
Migration
The method \Codein\eZColorPicker\FieldType\ColorPicker\Type::acceptValue will accept a single string and convert it into a color. Following formats are converted into a valid value object :
You can use this feature when writing migrations.
We also provide a color converter service for your needs here.
Acknowledgement
This bundle uses Pickr (https://github.com/Simonwep/pickr) under the MIT Licence.