Javascript screen colorDepth property returns the bit depth of the color palette retrieved from the graphic properties of the computer system. colorDepth property of the javascript screen object returns the color quality property of the client’s computer such as 16 bit, 24 bit or 32 bit that depends upon graphics card and its memory (buffer). You can match the value returned by the javascript screen object colorDepth property with color quality property of client computer system. In Windows XP you can see the color quality property in the Display properties that can be accessed by right clicking on desktop and selecting the properties from the menu or by selecting Display icon in the control panel. Display properties dialog box shows the tabs for different types of display settings such as wallpaper, screensaver, themes, appearance and settings. In the settings tab you can see the color quality property adjusted for the current graphics device to display the optimal color depth such as 16 bit, 24 bit or 32 bit.

Syntax for Javascript screen colorDepth property

screen.colorDepth

or

window.screen.colorDepth

You can use any of the above syntax to access the javascript screen colorDepth property.

Example of Javascript screen colorDepth property

<script type="text/javascript" language="javascript">
    document.write(screen.colorDepth);

    document.write("<br />");

    document.write(window.screen.colorDepth);
</script>

Continue to next tutorial: Javascript screen height property to learn how to get the display height as number of pixels along y-axis of screen.

Recent JavaScript Tutorials

Javascript FSO ShortPath property

Javascript FileSystemObject (FSO) provides a ShortPath property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Path Property

Javascript FileSystemObject (FSO) provides the Path property that can be accessed through the file object or folder object returned by the GetFile or GelFolder method

Javascript FSO Type property

Javascript FileSystemObject (FSO) provides a Type property that can be accessed through file object or folder object returned by the GetFile or GetFolder method

Javascript FSO ShortName property

Javascript FileSystemObject (FSO) provides a ShortName property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Name Property

Javascript FileSystemObject (FSO) provides a Name property that can be accessed using file object or folder object.