# Text element background colour

**URL:** <https://forum.bubble.io/t/text-element-background-colour/237133>\
**Category:** APIs\
**Created:** [December 14, 2022, 8:12pm UTC](https://forum.bubble.io/t/text-element-background-colour/237133 "2022-12-14T20:12:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashhodges15](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@ashhodges15](https://forum.bubble.io/u/ashhodges15)\
**Post date:** [December 14, 2022, 8:12pm UTC](https://forum.bubble.io/t/text-element-background-colour/237133/1 "2022-12-14T20:12:03Z")

</div>

Hi,

I’m trying to have the colour of a text elements background change depending on the text within it which is pulled from an API and is a percentage value. I can’t seem to work it out I am new to bubble so could be something simple? Or not possible? 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![sem](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sem](https://forum.bubble.io/u/sem)\
**Post date:** [December 15, 2022, 6:00am UTC](https://forum.bubble.io/t/text-element-background-colour/237133/2 "2022-12-15T06:00:20Z")

</div>

If it is always a number (percentage) you can probably use conditional statements. “When [value from api] \< 50 and [value from api] \> 25” set font color to orange
