Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML DOM Screen colorDepth Property
Next article icon

HTML DOM Screen colorDepth Property

Last Updated : 14 Jun, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

The Screen colorDepth property is used to return the bit depth of the color palette for displaying images, in bits per pixel.
The possible values are : 

  • 1 bit per pixel
  • 4 bits per pixel
  • 8 bits per pixel
  • 15 bits per pixel
  • 16 bits per pixel
  • 24 bits per pixel
  • 32 bits per pixel
  • 48 bits per pixel

Syntax :  

screen.colorDepth

Return Value: A Number, representing the bit depth of the color palette for displaying images, in bits per pixel.

Below program illustrates the Screen colorDepth Property :

Getting the width of the user screen.  

HTML
<!DOCTYPE html> <html> <head>     <title>       Screen colorDepth property in HTML     </title>     <style>         h1 {             color: green;         }                  h2 {             font-family: Impact;         }                  body {             text-align: center;         }     </style> </head>  <body>     <h1>GeeksforGeeks</h1>     <h2>Screen colorDepth property</h2>      <p>       or returning the color depth, double       click the "Colour Depth" button:     </p>      <button ondblclick="color_depth()">       Color Depth     </button>      <p id="depth"></p>      <script>         function color_depth() {              var c =                  "Color Depth in bits per pixel : "                             + screen.colorDepth;             document.getElementById("depth").innerHTML = c;          }     </script> </body> </html> 

Output: 

Before clicking the button:

After clicking the button:

Supported Browsers: The browser supported by HTML|Screen color Depth property are listed below: 

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 4
  • Firefox 1
  • Opera 12.1
  • Safari 1

Next Article
HTML DOM Screen colorDepth Property

S

Shubrodeep Banerjee
Improve
Article Tags :
  • Web Technologies
  • HTML
  • HTML-Property

Similar Reads

    HTML DOM Screen availWidth Property
    The Screen availWidth property is used for returning the width of the user's screen, in pixels. The value returned by the Screen availWidth property is excluding the interface features like the Windows Taskbar. Syntax: screen.availWidth Return Value: It returns a numeric value which , representing t
    1 min read
    HTML DOM Style color Property
    The DOM style color property is used to set or return the color of the text. Syntax: It is used to set the color property.object.style.colorIt is used to return the color property.object.style.color = "color|initial|inherit" Return Values: It returns a string value that represents a text-color of an
    1 min read
    HTML DOM Screen availHeight Property
    The Screen availHeight property is used for returning the height of the user's screen, in pixels. The value returned by the Screen availHeight property is excluding the interface features like the Windows Taskbar. Syntax : screen.availHeightReturn Values: It returns a numeric value which, representi
    1 min read
    HTML | DOM HR color Property
    The DOM HR color property is used to set or return the value of the color attribute of a <hr> element. Note: This property is not supported by HTML5 Syntax: It returns a HR color property.hrobject.colorIt sets the HR color property.hrobject.color="value" Property Values: color_name: It holds t
    2 min read
    HTML DOM Screen width Property
    The Screen width property is used for returning the total width of a user's screen. It returns the total width of the screen in pixels. Syntax: screen.widthReturn Value: A Number, representing the total width of the user's screen, in pixels Below program illustrates the Screen width Property : Check
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences