# SQL Query for color in Equipment Schedule component

**URL:** <https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436>\
**Category:** Ignition\
**Created:** [December 6, 2016, 11:00pm UTC](https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436 "2016-12-06T23:00:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [December 6, 2016, 11:00pm UTC](https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436/1 "2016-12-06T23:00:23Z")

</div>

I would like to use the Equipment Schedule component, and base the data in the Items and Scheduled Events properties off a SQL query. How do I get a color into the Foreground and Background fields of the Items property, for example? I tried putting something like ‘BBBBBB’ but it didn’t recognize it as a color. I am using SQL Server, if that matters.

Thanks for your time and help!

---

<div class="post-metadata">

**Author:** ![pphillips](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pphillips](https://forum.inductiveautomation.com/u/pphillips)\
**Post date:** [December 7, 2016, 2:58pm UTC](https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436/2 "2016-12-07T14:58:13Z")

</div>

Before assigning a color to a component property, you will likely need to convert the desired color string to a color using the script function: system.gui.color(color)

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [December 7, 2016, 4:36pm UTC](https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436/3 "2016-12-07T16:36:17Z")

</div>

Try formatting the string to this:

```auto
java.awt.Color[r=255,g=23,b=23,a=100]
```

---

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [December 7, 2016, 4:39pm UTC](https://forum.inductiveautomation.com/t/sql-query-for-color-in-equipment-schedule-component/12436/4 "2016-12-07T16:39:01Z")

</div>

[quote=“jpark”]Try formatting the string to this:

```auto
java.awt.Color[r=255,g=23,b=23,a=100]
```

That worked! Thank you so much!
