screenColors

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the screenColors
screenColors()
Summary

Returns the number of colors the screen can display.

Introduced1.0
OSmac, windows, linux
Platformsdesktop, server
Example
the screenColors
if the screenColors = 2 then put "black & white" into graphicsLevel
Values
NameTypeDescription
return

The screenColors function returns a positive integer which is a power of two.

RelatedProperty: colorWorld, colorMap, borderPixel, dontRefresh, remapColor
Control Structure: function
Keyword: integer
Object: image
Glossary: return, application
Command: unlock colorMap
Function: screenType
Description

Use the screenColors function to determine the color capacity of the screen. For example, you might display different images depending on the number of colors available.

If the system has more than one monitor, the screenColors function returns the number of colors for the main screen.

The expression

the screenColors

is equal to

2 ^ (the screenDepth)

The value returned by the screenColors function is updated only when you start up the application. If you change the screen settings after starting up the application, you must quit and restart to update the screenColors.