# Dynamic values for Kirby 4 Color field?

**URL:** <https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216>\
**Category:** Questions\
**Tags:** v4\
**Created:** [December 6, 2023, 3:21am UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216 "2023-12-06T03:21:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HYR](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hyr/32/12830_2.png) [@HYR](https://forum.getkirby.com/u/HYR)\
**Post date:** [December 6, 2023, 3:21am UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/1 "2023-12-06T03:21:18Z")

</div>

I’m trying to convert from a `color-palette` field type to the new `color` field type in Kirby 4. This yaml is used with `extends`. What’s the proper way to pull in an array of colors from the config?

In the code below `customizable.palette-options` is defined in the config file.

```yml
label: Color
type: color
options:
  type: query
  query: kirby.option('customizable.palette-options')
  key: "{{ arrayItem.key }}"
  value: "{{ arrayItem.value }}"
width: 1/2

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 6, 2023, 11:02pm UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/2 "2023-12-06T23:02:04Z")

</div>

Doesn’t seem to work. Alternative for the moment could be a PHP field blueprint.

---

<div class="post-metadata">

**Author:** ![felixf](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixf/32/8125_2.png) [@felixf](https://forum.getkirby.com/u/felixf)\
**Post date:** [December 14, 2023, 4:24pm UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/3 "2023-12-14T16:24:12Z")

</div>

I am in the same position now, needing to load the options of a color field from a structure defined in `site.yml`. Can you elaborate what you mean by “PHP field blueprint”, Sonja?

Thank you!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 14, 2023, 4:30pm UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/4 "2023-12-14T16:30:11Z")

</div>

You can create Blueprints in PHP instead of yaml, see [Programmable blueprints | Kirby CMS](https://getkirby.com/docs/cookbook/panel/programmable-blueprints)

---

<div class="post-metadata">

**Author:** ![HYR](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hyr/32/12830_2.png) [@HYR](https://forum.getkirby.com/u/HYR)\
**Post date:** [December 15, 2023, 7:33pm UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/5 "2023-12-15T19:33:11Z")

</div>

@texnixe Thanks! This is a great work-around until the field supports the KQL.

---

<div class="post-metadata">

**Author:** ![HYR](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hyr/32/12830_2.png) [@HYR](https://forum.getkirby.com/u/HYR)\
**Post date:** [December 15, 2023, 7:35pm UTC](https://forum.getkirby.com/t/dynamic-values-for-kirby-4-color-field/30216/6 "2023-12-15T19:35:13Z")

</div>

Here’s what my field definition looks like right now:

 ![CleanShot 2023-12-15 at 12.33.55@2x](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/e/eba61e3311673c15d0586a358b7cd2d691f1e2e4.png)
