# Perspective text field background color

**URL:** <https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [January 28, 2021, 4:18pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706 "2021-01-28T16:18:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [January 28, 2021, 4:18pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706/1 "2021-01-28T16:18:00Z")

</div>

I should be missing somthing…

I want to change the background color of a text field. I enter a color in the props editor but it does not change on the component. I’m doing the same with a label and it works fine.

Help?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 28, 2021, 4:30pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706/2 "2021-01-28T16:30:48Z")

</div>

What version of Perspective are you using?  
What color are you supplying?

---

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [January 28, 2021, 4:53pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706/3 "2021-01-28T16:53:55Z")

</div>

Version is 8.0.12.

It seems I cannot the expression color(R,G,B) is not working. I must use a color like #FFFFFF.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 28, 2021, 5:43pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706/4 "2021-01-28T17:43:45Z")

</div>

Correct, you may not use the `Color` expression, because that actually returns a `java.awt.Color` object, whereas Perspective (actually, CSS) will expect a string. You’re not even able to use the `toString` expression on the Color expression because it still returns as something like `color(R, G, B, A)`, which won’t work. I _was_ able to get the following to work, but it’s really more effort than you probably want to put into this:

```auto
replace(toStr(color(0,255,0)), "color", "rgb")

```

You’d be better off creating your own project script to create a color based off of values and return a proper hex color.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 28, 2021, 5:49pm UTC](https://forum.inductiveautomation.com/t/perspective-text-field-background-color/42706/5 "2021-01-28T17:49:53Z")

</div>

You can also just use the css builtin [`rgb`](https://www.w3schools.com/cssref/func_rgb.asp) directly as a property value.
