color
Experiments
Per-trial text-color control for specific screen elements (fixation cross, individual word stimuli, trial text, feedback text) or the whole page. The colors are applied when the trial is shown and cleared when it ends.
Syntax
Section titled “Syntax”Put a single color in the cell, either a color name like blue or a hex code like #FF0000, to color all text on the page for that trial.
To color specific elements instead, list target:color pairs separated by ;, for example stim1:green;stim2:red;fixation:yellow. Write the pairs without spaces around : and ;. Colors must be names or hex codes; function syntax such as rgb(...) is not accepted.
Options
Section titled “Options”Recognized target keys:
| Target | Element affected |
|---|---|
color (or single-value form) | all page text |
fixation | the fixation cross |
stimN (e.g. stim1, stim2) | word stimulus N; word stimuli only |
trialText | the trial text |
feedback | the feedback text on the trial’s feedback screen |
| anything else | silently unused |
Defaults & missing values
Section titled “Defaults & missing values”If the column is absent or the cell is left empty, the trial falls back to its textColor cell. If that is also empty, no per-trial coloring happens at all.
At the end of the trial the colors are cleared: page text returns to the experiment’s overall text color, and element-specific colors are removed.
Works with
Section titled “Works with”textColor: serves as the fallback source of the same syntax; a filled-incolorcell wins overtextColor.- Feedback: a whole-page color also colors the feedback text instead of the experiment’s default feedback color; a
feedback:<color>target colors the feedback text too and takes precedence over the whole-page color. stimNtargets affect only word stimuli; image stimuli are not affected.
Examples
Section titled “Examples”| type | stim1 | stimFormat | color |
|---|---|---|---|
| test | apple | word | blue |
type,stim1,stimFormat,color test,apple,word,blue
Whole-page text (including the word) is blue for this trial.
| type | stim1 | stim2 | stimFormat | fixation | color |
|---|---|---|---|---|---|
| test | left | right | word | 500 | stim1:green;stim2:red;fixation:yellow |
type,stim1,stim2,stimFormat,fixation,color test,left,right,word,500,stim1:green;stim2:red;fixation:yellow
Word 1 green, word 2 red, fixation cross yellow.
| type | stim1 | stimFormat | feedback | color |
|---|---|---|---|---|
| practice | apple | word | 600 | feedback:#FF0000 |
type,stim1,stimFormat,feedback,color practice,apple,word,600,feedback:#FF0000
Feedback text shown in red.
Tips & gotchas
Section titled “Tips & gotchas”- Only the first color or target list in the cell is read; anything after it is ignored.
- Write pairs without spaces around
:and;; a pair with spaces around the separators is silently ignored. - Target keys are case sensitive:
trialTextmust be camelCase exactly, andFixationwould be ignored. - Stimulus targets must be exactly
stimfollowed by the number (stim1,stim2, …); any other key containing “stim” can break the trial. - Color values cannot contain parentheses or spaces, so
rgb()/hsl()are not usable in this column.
Common combinations
Section titled “Common combinations”color appears in these worked recipes:
- Stroop colour naming: Show colour words in matching or clashing ink and score keyboard responses to the ink colour.