Change any selected object(s) to selected color with Spectrum Colorpicker
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I’m using Spectrum Colorpicker with a fabricjs canvas. I’d like to be able to instead of change the draw color to change the color of any selected object(s); E.g. IText. Please have it work with Fabric.JS 1.7.22.

If you could, please update this example:

Thanks and let me know if I can provide more information.

awarded to Wuddrum

Crowdsource coding tasks.

1 Solution

This should be what you're looking for: JSFiddle

EDIT: Updated the solution to apply the selected color to new text objects.

EDIT2: Updated the solution with support for changing drawing color.

Looks right! Thanks Wuddrum
sharper 8 months ago
Hi Wuddrum, would you be interested in having this work for the drawingColor as well? I can tip the same amount as this bounty.
sharper 7 months ago
Hey sharper. I can take a look soon, any examples of what objects/actions exactly to apply a color to?
Wuddrum 7 months ago
Awesome, thank you. I'd just like the color that is applied to anything selected to also set the draw color
sharper 7 months ago
I've updated the solution to apply the selected color to new text objects. I assume that's what you mean with drawingColor, since I can't find any variable under that name.
Wuddrum 7 months ago
Hey again, thank you—that looks like it's halfway there. I blame myself, I should've been more descriptive. I dug more and found this: In this example, the line color can be changes. I'd like the color chosen to apply to 1) any selected, 2) any to-be-added, and 3) and drawing. I hope this makes more sense. Thanks!
sharper 7 months ago
Alright, I'll take a look at it tomorrow, it's getting late here.
Wuddrum 7 months ago
Sure thing, I appreciate it. Cheers!
sharper 7 months ago
I've updated the solution once again, it should now do what you had in mind.
Wuddrum 7 months ago
This looks great, thanks!
sharper 7 months ago