Lingo Dictionary > A-C > colorDepth

 

colorDepth

Syntax

the colorDepth

Description

System property; determines the color depth of the computer's monitor.

In Windows, using this property lets you check and set the monitor's color depth. Some video card and driver combinations may not enable you to set the colorDepth property. Always verify that the color depth has actually changed after you attempt to set it.

On the Macintosh, this property lets you check the color depth of different monitors and change it when appropriate.

Possible values are the following:

1

Black and white

2

4 colors

4

16 colors

8

256 colors

16

32,768 or 65,536 colors

32

16,777,216 colors


If you try to set a monitor's color depth to a value that monitor does not support, the monitor's color depth doesn't change.

On computers with more than one monitor, the colorDepth property refers to the monitor displaying the Stage. If the Stage spans more than one monitor, the colorDepth property indicates the greatest depth of those monitors; colorDepth tries to set all those monitors to the specified depth.

This property can be tested and set.

Example

This statement tells Director to play the segment Full color only if the monitor color depth is set to 256 colors:

if the colorDepth = 8 then play movie "Full color"

Example

The following handler tries to change the color depth, and if it can't, it displays an alert:

on TryToSetColorDepth desiredDepth
	the colorDepth = desiredDepth
	if the colorDepth = desiredDepth then
		return true
	else
		alert "Please change your system to" && desiredDepth &&"color depth and reboot."
		return false
	end if
end

When changing the user's monitor color depth settings, it is good practice to restore the original depth when the movie has finished. In Windows, the command set the colorDepth = 0 restores the user's preferred settings from the control panel.

See also

switchColorDepth