Skip to content

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.

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.

ValueEffect
empty cell (or column absent)Skip; the project’s setup background stays in effect
Named color, e.g. redSolid background of that color
Hex, e.g. #FFFFFFSolid 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 CSSSilently ignored by the browser; the project background remains
  • 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 bgColor affects only its own trial and is reset before the next one.
  • background column: a trial can combine a bgColor color with a background image; 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 bgColor on a type: form row is overridden.
  • Applied at the same moment as textSize and textColor, before the stimuli are displayed.
typestim1stimFormatbgColor
testappleword#000000
testpearword

Trial 1 runs on a black background; trial 2 reverts to the project default.

typestim1stimFormatbgColor
testface1.jpgrgb(200,220,255)

A light blue background for one image trial.

  • The default background is grey #808080, not white.
  • Gradients and other CSS background shorthand syntax work even though the column is named “color”.