# Is it possible to save background colors in a list?

**URL:** <https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271>\
**Category:** Questions about Thunkable X\
**Created:** [October 3, 2021, 4:41am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271 "2021-10-03T04:41:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 3, 2021, 4:41am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/1 "2021-10-03T04:41:36Z")

</div>

I’d like to know if it is possible to save background colors of certain buttons in a list. When I tried it, nothing showed up in the list. This is basically what I want to do:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/3/53e4de3ffdfce5c1536eaf295cc2dea8b647ff57.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/e/fe68bdadebd697418456e3e815c200c04b61bc0d.png)  
However, no background color appears on any of the other buttons. Surprisingly, when I try this:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/3/c3d537f2d63feef936a68b94fd5e1442ee4dc0df.png)  
and I try to display the code (the random colour function just retrieves a random item from the all colors list), I see each button with the corresponding item of the list as the background color. This happens even though I’m creating the all colors list out of background colors. Why is the variable code working and the variable color clicked list not working?  
Thanks, I hope I made any sense!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 3, 2021, 6:30am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/2 "2021-10-03T06:30:51Z")

</div>

Yes, I’ve been able to store and retrieve background colors using lists.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 3, 2021, 8:37am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/3 "2021-10-03T08:37:33Z")

</div>

I just tested the use of background color in relation to the **WDC** and it works.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 3, 2021, 1:02pm UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/4 "2021-10-03T13:02:56Z")

</div>

Thank you! Surprisingly, I tried after a day and now it works.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 7:10am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/5 "2021-10-04T07:10:46Z")

</div>

And it’s not working again (the buttons don’t have changed background colors).  
This is what I’m doing:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/e/ae3a28685da12fae4cd0063ccbd97ac8fef978eb.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/6/36152214dbcec2499f607d76a77b16cab3dfe9c5.png)

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 7:24am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/6 "2021-10-04T07:24:50Z")

</div>

… try to put some:  
repeat while i\<4  
wait 0.001 after count…  
and a wait 0.001 inside count

that will give time to loop until is done.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 7:27am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/7 "2021-10-04T07:27:26Z")

</div>

Thanks, let me try that!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 7:36am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/8 "2021-10-04T07:36:39Z")

</div>

Nope, I still don’t see the colors.

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 8:04am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/9 "2021-10-04T08:04:24Z")

</div>

If you provide me the problem you want to achieve (and not blocks, but what is your action and what do you expect to get), ill think about it 🤔 (sometimes is easier to think some issue from the scratch, than trying to correct other`s code 😌)

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 8:11am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/10 "2021-10-04T08:11:08Z")

</div>

this is only to check if you can save colors to a list 😌  
[https://x.thunkable.com/copy/d0d1d5a7a39245025d126a9824dac672](https://x.thunkable.com/copy/d0d1d5a7a39245025d126a9824dac672)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 4, 2021, 8:52am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/11 "2021-10-04T08:52:59Z")

</div>

> [@codeswept](#):
>
> And it’s not working again (the buttons don’t have changed background colors).

Are you using **DnD**?  
If yes, then I am facing the same thing. The issue is not consistent. It works and some times it doesn’t.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:32am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/12 "2021-10-04T09:32:02Z")

</div>

Thank you @mimostel , but when I try that I don’t get the background colors in the buttons. I’m trying to use the background colors of some buttons after saving them in a list, but I realised that the list seemed empty even after running the code to save the colours. So, to test whether the list is actually populated, I need to display the contents using buttons was the only way I could think of.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:33am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/13 "2021-10-04T09:33:00Z")

</div>

I’m using StP, for the rows, columns, and cloning (I’m working on my Mastermind app).

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 9:33am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/14 "2021-10-04T09:33:45Z")

</div>

Haha, @muneer already showed his app… go for it and “steal” his ideeas 🤣

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:34am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/15 "2021-10-04T09:34:20Z")

</div>

Haha, let me go and check out the code.

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 9:35am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/16 "2021-10-04T09:35:54Z")

</div>

> [@codeswept](#):
>
> So, to test whether the list is actually populated, I need to display the contents using buttons was the only way I could think of.

I always use “alert” block to display at a point something.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:39am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/17 "2021-10-04T09:39:11Z")

</div>

But how can I display colors using an alert?

---

<div class="post-metadata">

**Author:** ![mimostel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mimostel/32/107661_2.png) [@mimostel](https://community.thunkable.com/u/mimostel)\
**Post date:** [October 4, 2021, 9:40am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/18 "2021-10-04T09:40:41Z")

</div>

If you put set alert message = background color, will get something in like rgba(x,x,x,x)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:42am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/19 "2021-10-04T09:42:00Z")

</div>

Oh, I didn’t know that! Let me try that.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [October 4, 2021, 9:46am UTC](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271/20 "2021-10-04T09:46:41Z")

</div>

I finally realised the issue! I’ve been setting the variable color clicked list to empty before doing the check function and other functions! I’ve shifted it to the end, and now everything works! Thank you so much for your help!

[Next page](https://community.thunkable.com/t/is-it-possible-to-save-background-colors-in-a-list/1540271.md?page=2)
