# Changing background color within an experiment

**URL:** <https://mworks.discourse.group/t/changing-background-color-within-an-experiment/1100>\
**Category:** Support\
**Created:** [June 3, 2025, 4:58pm UTC](https://mworks.discourse.group/t/changing-background-color-within-an-experiment/1100 "2025-06-03T16:58:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hokysung](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@hokysung](https://mworks.discourse.group/u/hokysung)\
**Post date:** [June 3, 2025, 4:58pm UTC](https://mworks.discourse.group/t/changing-background-color-within-an-experiment/1100/1 "2025-06-03T16:58:17Z")

</div>

Hi Chris,

I would like to be able to change the background color/alpha during an experiment, presumably by manually changing color/alpha variables during an experiment.

If I were to go the route of using stimuli, e.g. blank fullscreen stimulus, I do want this to be on at all times across the multitask code, and therefore immune to any clear\_stimulus\_display() calls that exist. Would there be a way to do this?  
If I do something like the following:

```auto
clear_stimulus_display()
live_queue_stimulus(blank_fullscreen)
update_stimulus_display()

```

Does both of the updates happen at once, i.e. there will be **no** frame in which blank fullscreen stimulus is not present?

Also, if you have a better suggestion that doesn’t require using a stimulus (e.g. somehow directly using stimulus\_display background colors), please let me know. Thank you!

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [June 3, 2025, 9:35pm UTC](https://mworks.discourse.group/t/changing-background-color-within-an-experiment/1100/2 "2025-06-03T21:35:04Z")

</div>

Hi Hokyung,

> Does both of the updates happen at once, i.e. there will be **no** frame in which blank fullscreen stimulus is not present?

They don’t happen at once. There will be at least one frame where the blank screen stimulus is not present.

> Also, if you have a better suggestion that doesn’t require using a stimulus (e.g. somehow directly using stimulus\_display background colors), please let me know.

Using a stimulus is the only way. Although you can configure the [default background color](https://mworks.github.io/documentation/latest/components/stimulus_display.html#background-color), it’s fixed when the experiment is loaded and can’t be changed later. Sorry!

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 5, 2025, 2:31pm UTC](https://mworks.discourse.group/t/changing-background-color-within-an-experiment/1100/3 "2025-08-05T14:31:21Z")

</div>


