xmon / color-picker-type-bundle
The ColorPickerTypeBundle extends Symfony2 form types, creates a new ColorPicker form type, to display a javascript color picker.
Installs: 32 868
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 7
Language:JavaScript
Type:symfony-bundle
pkg:composer/xmon/color-picker-type-bundle
Requires
- php: >=5.4
- symfony/assetic-bundle: *
- symfony/framework-bundle: ^2.1 || ^3.0
This package is not auto-updated.
Last update: 2025-12-28 14:01:27 UTC
README
DEPRECATED: This bundle is no longer maintained. Symfony includes
ColorTypenatively since version 5.1.
Migration to native
Before (with this bundle)
use Xmon\ColorPickerTypeBundle\Form\Type\ColorPickerType; $builder->add('color', ColorPickerType::class);
Now (Symfony 5.1+)
use Symfony\Component\Form\Extension\Core\Type\ColorType; $builder->add('color', ColorType::class);
Hex color validation
If you were using the HexColor constraint, you can replace it with Regex:
use Symfony\Component\Validator\Constraints as Assert; #[Assert\Regex( pattern: '/^#[0-9a-fA-F]{6}$/', message: 'The color {{ value }} is not valid.' )] public ?string $color = null;
History
This bundle was created in 2013 for Symfony 2, when there was no native form type for colors. It integrated the jscolor library to provide a JavaScript color picker.
With the arrival of HTML5 <input type="color"> and its universal support in modern browsers, Symfony added native ColorType in version 5.1, making this bundle obsolete.
License
MIT