wallacemaxters / filament-image-color-picker
A custom Form Component to pick color from image
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: ^8.1
- filament/forms: *
- spatie/laravel-package-tools: ^1.15.0
README
This library contains a custom form field to pick color from a image.
Install
composer require wallacemaxters/filament-image-color-picker
Usage
Basic Input Usage example:
use WallaceMaxters\FilamentImageColorPicker\ImageColorPicker; // return $form->schema([ TextInput::make('image_url')->url()->live(), ImageColorPicker::make('color') ->columnSpanFull() ->image(fn ($get) => $get('image_url')), ]);
Use ImageColorPicker as Action:
Forms\Components\ColorPicker::make('color') ->suffixAction(fn ($get) => Forms\Components\Actions\Action::make('color-from-image') ->action(function ($set, array $data) { $set('color', $data['color']); }) ->icon('heroicon-o-eye-dropper') ->form([ ImageColorPicker::make('color') ->format('hsl') ->image(fn() => $get('image_url')) ]) ),