# Setting background color to black produces white screen on Pavlovia

**URL:** <https://discourse.psychopy.org/t/setting-background-color-to-black-produces-white-screen-on-pavlovia/46538>\
**Category:** Online experiments\
**Created:** [February 5, 2026, 3:17pm UTC](https://discourse.psychopy.org/t/setting-background-color-to-black-produces-white-screen-on-pavlovia/46538 "2026-02-05T15:17:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valsecchimat](https://avatars.discourse-cdn.com/v4/letter/v/e19adc/32.png) [@valsecchimat](https://discourse.psychopy.org/u/valsecchimat)\
**Post date:** [February 5, 2026, 3:17pm UTC](https://discourse.psychopy.org/t/setting-background-color-to-black-produces-white-screen-on-pavlovia/46538/1 "2026-02-05T15:17:14Z")

</div>

**OS** System Info:  
Operating System: Windows-10-10.0.26200-SP0  
**PsychoPy version** PsychoPy 2025.2.4

Python Version: 3.10.11

**Standard Standalone Installation? (yes**  
**URL of experiment:** [Pavlovia](https://pavlovia.org/valsecchimat/HelloWorldDemo2)  
**Do you want it to also run locally? (if possible**  
**What are you trying to achieve?:**

I want to show a colored polygon on a black background

**What did you try to make it work?:**

I set the background color in the settings/screen tab to black, which inserts $(-1.0000, -1.0000, -1.0000) and the color of the polygon by setting the appearance/fill color tab.

**Link to the most relevant existing thread you have found:**

**What specifically went wrong when you tried that?**

First of all when running the script locally through psychopy, everyghing seems to work fine, the background is black and the polygon has the color I pick.

On pavlovia instead:

If I set the polygon color to white, i.e. $(1.0000, 1.0000, 1.0000) the background appears grayish, the polygon is black

If I set the polygon to say red, i.e. $(1.0000, -1.0000, -1.0000) I get the following error:

- **the color components should all belong to [-1, 1]**

I thought that maybe somehow on Pavlovia color values are coded between 0 and 1, so I tried to set the background color to gray $(0.0039, 0.0039, 0.0039), and the polygon to red without the negative values $(1.0000, 0.0000, 0.0000). Now the background actually looks black on Pavlovia and I don’t get error messages, which is consistent with my hypothesis, but the polygon looks black instead of red. What’s really bizarre is that if I set the color to red using the word red it looks OK.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![valsecchimat](https://avatars.discourse-cdn.com/v4/letter/v/e19adc/32.png) [@valsecchimat](https://discourse.psychopy.org/u/valsecchimat)\
**Post date:** [February 13, 2026, 12:32pm UTC](https://discourse.psychopy.org/t/setting-background-color-to-black-produces-white-screen-on-pavlovia/46538/2 "2026-02-13T12:32:09Z")

</div>

For anyone interested, I think I figured it out.

The problem seems to be due to the $ sign which is automatically inserted by the builder when you pick the color from the interface. That seems to work on python but not online. Removing the $ in front of the color definition makes the code behave the same way both on python and online. What is a little bizarre is that you need to remove the $ even if you set the color every trial based on a variable.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 13, 2026, 2:43pm UTC](https://discourse.psychopy.org/t/setting-background-color-to-black-produces-white-screen-on-pavlovia/46538/3 "2026-02-13T14:43:51Z")

</div>

I think this might be that previously the colour picker didn’t add the $ sign which failed online so we (possibly I) edited to code to add it in translation.
