How to manipulate color in DMDX

 

DMDX can control both the background color of the experiment and the color of text in individual items.  We will cover various methods to accomplish each in turn

 

Background Color

You can set the background color for the entire experiment using any of the following keywords in the parameter line

<BackgroundColor N>

<bc N>

<bgc N>

 

N is an RGB triplet. It indicates the background color as a composite of (R)ed, (G)reen, and (B)lue.  You indicate the intensity of each of these color components on an 8-bit intensity scale from 0 Ð 255. 

000 means form a color with 0 intensity red, 0 intensity green, and 0 intensity blue.  This color would be black.

255255255 means form a color with 255 intensity red, 255 intensity green, and 255 intensity blue.  This color would be white.  White is the default background color if you do specify one.

210210210 is a pleasing gray that we use in our labs. 

You can use RGB calculators to determine the RGB triplet value for various colors you might choose.

 

You can also change the background color for a specific frame of an item by using any of the above keywords in a specific frame of an item.  Used this way, background color will only change for that specific frame.

 

Text Color

There are three ways to modify the color of text in your experiment.  If you do not specify a writing color in one of these ways, the default is black.

 

1.  You can specify a default writing color for all text in the experiment by using any of the following keywords in the parameter line.

<WritingColor N>

<w N>

<wc N>   

Again, N is an RGB triplet as discussed above for background color.  It is important to note that if you specify a writing color using these keywords, it will override the WYSIWYG features of DMDX discussed below.

 

2.  You can use the same writing color keywords in a specific frame of an item.  This will set the writing color for just that frame.  For example in the following item, the word Black will be presented in black script followed by the word BLUE presented in blue script.

          10 <wc 000000000>ÒBlackÓ <% 30> / <wc 000000255> ÒBLUEÓ <% 30>/;

 

3.  You can specify color using the What you see is what you get (WYSIWYG) features of DMDX.  Assuming you have not used the writing color keywords discussed above, DMDX will use the actual color of the text in your itemfile to determine the color to present the text in.  For example in the following item, the word BLUE will be presented in red script.

 

10 ÒBLUEÓ/;

 

created by Nicole Strang

last edited on 11-22-2005