<head> of your html document
<script type="text/javascript">
var colBit1 = screen.colorDepth;
</script>
<body>
<script type="text/javascript">
<!--
document.write(""+colBit1+"-bit");
//-->
</script>
Screen Colour Depth - Displays:
Save the following script as colourdepth.js
<!--
var colBit2 = screen.colorDepth;
document.write(""+colBit2+"-bit");
// or
// document.write(""+screen.colorDepth+"-bit");
// without variable
//-->
<body> of your html document
<script src="/js/colourdepth.js" type="text/javascript"></script>
Screen Colour Depth - Displays:
<body> of your html document
<script type="text/javascript">
<!--
var colBit3 = screen.colorDepth;
document.write("Screen Colour Depth is "+colBit3+"-bpp");
// or
// document.write("Screen Colour Depth is "+screen.colorDepth+"-bpp");
// without variable
//-->
</script>
Screen Colour Depth - Displays:
In computer graphics, colour depth, or bit depth, is the number of bits used to represent the colour of a single pixel in a bit-mapped image or video frame buffer. This concept is also known as bits per pixel (bpp), particularly when specified along with the number of bits used. Higher colour depth gives a broader range of distinct colors. Colour depth is only one aspect of colour representation expressing how finely levels of colour can be expressed; the other aspect is how broad a range of colours can be expressed, the gamut.