bgColor
Experiments
Sets the page background for a single trial. When the cell has a value, it is applied verbatim as the page’s CSS background when the trial is shown. Use it to override the project-wide background color from the setup on specific trials.
Syntax
Section titled “Syntax”Put a CSS color in the cell, e.g. black, #FFFFFF, or rgb(200,220,255). Any CSS background shorthand value works, including gradients. The value is applied exactly as written, with no parsing or validation; the browser silently ignores invalid values.
Options
Section titled “Options”| Value | Effect |
|---|---|
| empty cell (or column absent) | Skip; the project’s setup background stays in effect |
Named color, e.g. red | Solid background of that color |
Hex, e.g. #FFFFFF | Solid background |
rgb(...) / rgba(...) / hsl(...) | Solid background (any valid CSS color) |
Any CSS background shorthand, e.g. linear-gradient(#fff, #000) | Applied verbatim as the page’s background style |
| Invalid CSS | Silently ignored by the browser; the project background remains |
Defaults & missing values
Section titled “Defaults & missing values”- When the column is absent or the cell is left blank, the trial uses the project’s background color from the setup. If no color is configured there, the default is grey
#808080, not white. - The page background is repainted with the project color at the start of every trial, so a per-trial
bgColoraffects only its own trial and is reset before the next one.
Works with
Section titled “Works with”backgroundcolumn: a trial can combine abgColorcolor with abackgroundimage; the image is painted on top of the color. Both reset at the start of the next trial.- Form trials: when a form starts, the page is repainted with the survey background color from the setup, so
bgColoron atype: formrow is overridden. - Applied at the same moment as
textSizeandtextColor, before the stimuli are displayed.
Examples
Section titled “Examples”| type | stim1 | stimFormat | bgColor |
|---|---|---|---|
| test | apple | word | #000000 |
| test | pear | word |
type,stim1,stimFormat,bgColor test,apple,word,#000000 test,pear,word,
Trial 1 runs on a black background; trial 2 reverts to the project default.
| type | stim1 | stimFormat | bgColor |
|---|---|---|---|
| test | face1 | .jpg | rgb(200,220,255) |
type,stim1,stimFormat,bgColor test,face1,.jpg,"rgb(200,220,255)"
A light blue background for one image trial.
Tips & gotchas
Section titled “Tips & gotchas”- The default background is grey
#808080, not white. - Gradients and other CSS background shorthand syntax work even though the column is named “color”.