colorDepth property in JavaScript

colorDepth property in Javascript is used to return the bit depth of the color palette, which is used for displaying images.

Ex:

<html>

<body>

<script type="text/javascript">

if (screen.colorDepth<=8)

  document.body.style.background="Red"

else

  document.body.style.background="Green"

</script>

</body>

</html>


1.png

Ebook Download
View all
Learn
View all