# The new color field without # as value

**URL:** <https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246>\
**Category:** Questions\
**Tags:** v4\
**Created:** [December 8, 2023, 8:35pm UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246 "2023-12-08T20:35:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/johan/32/7322_2.png) [@johan](https://forum.getkirby.com/u/johan)\
**Post date:** [December 8, 2023, 8:35pm UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246/1 "2023-12-08T20:35:24Z")

</div>

Hi,

Currently updating to v4 and looking at the new color field. Nice!

One issue though is that the color fields I created for v3 didn’t have the actual # in the value.

 ![border-color](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/0/0ac5f3c5ca56826b3104d6a89f0c1d4dcab712a5.png)

Question is, is it possible to exclude the # from the new color field? And use # as a prefix again. This would make life easier migrating to the new field. Otherwise all color fields will need to manually be updated or something.

Best,  
Johan

---

<div class="post-metadata">

**Author:** ![moonwalk](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@moonwalk](https://forum.getkirby.com/u/moonwalk)\
**Post date:** [December 8, 2023, 8:40pm UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246/2 "2023-12-08T20:40:57Z")

</div>

Not without changing how the field works, because of how Kirby validates the saved field values.

---

<div class="post-metadata">

**Author:** ![GB\_DESIGN](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gb_design/32/14956_2.png) [@GB\_DESIGN](https://forum.getkirby.com/u/GB_DESIGN)\
**Post date:** [December 9, 2023, 5:54am UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246/3 "2023-12-09T05:54:14Z")

</div>

> [@johan](#):
>
> is it possible to exclude the # from the new color field?

What is the code for the output?  
Isn’t it a better way to remove the # character in the output and use the new core features of Kirby?

---

<div class="post-metadata">

**Author:** ![johan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/johan/32/7322_2.png) [@johan](https://forum.getkirby.com/u/johan)\
**Post date:** [December 9, 2023, 10:06am UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246/4 "2023-12-09T10:06:04Z")

</div>

Here’s an example of what I’m currently using:

```auto
custom:
  before: #
  label: Custom
  pattern: ^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
  type: text

```

```auto
<?php if ($backgroundPageColor->custom()->isNotEmpty()): ?>
main.bg-color-custom {
  background: #<?= $backgroundPageColor->custom() ?>;
}
<?php endif ?>

```

There are two issues:

1. Panel: current values will have to be updated since they don’t include the #
2. Need to remove the # from the output

The first issue is the most annoying one.

---

<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 9, 2023, 10:55am UTC](https://forum.getkirby.com/t/the-new-color-field-without-as-value/30246/5 "2023-12-09T10:55:16Z")

</div>

> [@johan](#):
>
> The first issue is the most annoying one.

Updating the pages should be pretty straightforward via a little script.
