Is there a way to use the color field with predefined options and store the color name instead of the actual color value?
For the editors it is great to have a visual preview of the color in the panel, but i think it would be great to have the possibility to later adjusts a color value a bit if needed. Therefore saving the name of the color would be a great option.
Is this somehow possible? Or do I have to work with a select field?
No, you cannot use the color field with color names as values instead of color values as values.
You would have to use a select field without visual clues, or one of the old color plugins (see plugins page) (don’t know if they have been updated for Kirby 4)
@silvan@Mirkokokoko This feature has been requested several times. I also tend to use CSS color names rather than HEX color values. However, with a workaround, it is possible to continue working with (predefined) color values in the panel and then replace them with the CSS color name in the template. I solved it in a project like this:
<div class="is-color-<?= $page->myColor()->value() ?>">
<!-- Your content -->
</div>
It saves color names (I use plain numbers) and previews the according color values in the panel. If a color value changed in the future, I’d update the list in config.php and accordingly in the websites stylesheet.