# Random Background colors from Switches

**URL:** <https://community.thunkable.com/t/random-background-colors-from-switches/76141>\
**Category:** Questions about Thunkable X\
**Tags:** switch\
**Created:** [May 11, 2019, 6:42am UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141 "2019-05-11T06:42:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALEX\_ANTONPIO\_NOTORE](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ALEX\_ANTONPIO\_NOTORE](https://community.thunkable.com/u/ALEX_ANTONPIO_NOTORE)\
**Post date:** [May 11, 2019, 6:42am UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/1 "2019-05-11T06:42:51Z")

</div>

Hi, i have to do a random change of background colors, previous selected by this four switches. I am using two screens. On the first i have the switches and after you click the button, you go to the second screen where the colors have to be changed. How can i do?

![Cattura](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/3/836ec9d2a0d050bfad22164b3fc2651c8f20e57b.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [May 11, 2019, 7:51am UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/2 "2019-05-11T07:51:46Z")

</div>

Hi,

check it

[https://x.thunkable.com/projects/5cd67a72c2b0332fddd20d8b/project/properties/designer/](https://x.thunkable.com/projects/5cd67a72c2b0332fddd20d8b/project/properties/designer/)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 11, 2019, 3:31pm UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/3 "2019-05-11T15:31:41Z")

</div>

Hi @ALEX_ANTONPIO_NOTORE, welcome to the Thunkable community! 👋

Do you have to use switches? Have you considered using sliders instead??

---

<div class="post-metadata">

**Author:** ![ALEX\_ANTONPIO\_NOTORE](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ALEX\_ANTONPIO\_NOTORE](https://community.thunkable.com/u/ALEX_ANTONPIO_NOTORE)\
**Post date:** [May 13, 2019, 7:04am UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/5 "2019-05-13T07:04:24Z")

</div>

Is there a way to select single colors?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [May 13, 2019, 7:17am UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/6 "2019-05-13T07:17:28Z")

</div>

This can be done. Instead of a random number generation block, use a numeric block with the desired color value.

Color can be set as follows

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/38a0f8b3ec7be1362beee4a7e74cdadfccd2527f.png)

or

#ff0  
#f0f8  
hsl(200, 100%, 50%)  
hsla(200, 100%, 50%, 0.1)  
rgba(0,0,0,0) or “transparent”.

---

<div class="post-metadata">

**Author:** ![ALEX\_ANTONPIO\_NOTORE](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@ALEX\_ANTONPIO\_NOTORE](https://community.thunkable.com/u/ALEX_ANTONPIO_NOTORE)\
**Post date:** [May 15, 2019, 6:27pm UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/7 "2019-05-15T18:27:56Z")

</div>

The app now works, thank you

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:13pm UTC](https://community.thunkable.com/t/random-background-colors-from-switches/76141/8 "2024-11-08T12:13:44Z")

</div>


