Update color values of SVG in real-time

I have an SVG image with three colors in a custom form field, and I have created three color pickers. I would like to know how to pass the reactive color picker values to my SVG form field, so that I can show the user how the final SVG image looks while tweaking the colors. This is the first solution that I have come up with, so I am open to better solutions!
5 Replies
Dan Harrin
Dan Harrin2y ago
you want to access the other color in the view? $evaluate(fn ($get) => $get(‘field_name’))
jaap4677
jaap4677OP2y ago
Hi Dan, to give you an Idea how my Form looks now
jaap4677
jaap4677OP2y ago
The illustration is a custom formfield so passing data from one field to another is what I'm looking for. Been looking at the automatic slugs technique (https://filamentphp.com/tricks/generate-slugs-without-overriding) But not sure how to pass values to a custom form field...
Filament
Generate slugs from a title whilst typing (without overriding) by R...
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
Dan Harrin
Dan Harrin2y ago
you shouldnt need to pass anything you can access other form data in the view with $evaluate and $get
jaap4677
jaap4677OP2y ago
Yess, got it sorted 🙌🏻
Want results from more Discord servers?
Add your server