How to load spectrum in v9 front end

I am trying to work out how to load the spectrum colour picker for a front end use in v9. Its automatically there when logged in as admin. I need to load it for a guest.

The v8 code ignores the asset (not even an error in the log):

$this->requireAsset('javascript', 'spectrum');
$this->requireAsset('css', 'spectrum');

What feature loads spectrum for the dashboard?
Can any feature load spectrum in the front end?

According to docs the core color picker is it n the CMS feature so it’s a lot to load just for the color picker.
Otherwise the asset group is core/colorpicker

1 Like

I ended up doing requireAsset for core/cms. It was the only variation I could get to work.

Adding ‘cms’ in the feature list unfortunately did nothing.

requireAsset for core/colorpicker did nothing. I suspect that is because when core/cms is already loaded then it would result in a double declaration of spectrum. Hence core/colorpicker and spectrum as assets are deliberately ‘nothing assets’ to ‘facilitate’ update from v8.

Yes you’re right, I double checked and it is not loaded as an independent asset anymore. Which is a bit ridiculous because the color form widget required it and only works when logged in or called from the dashboard…

By spooky coincidence, I was came across the problem when adding a Color Picker input to Form Reform.