The Screen.colorDepth read-only property returns the color depth of the screen.
Screen.colorDepth
MDN Reference