spikes
asked on
javascript color depth
How can i find the color depth of a visitors PC using Javascript
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Note that screen object inplemented first in NN4 version.
So you should check for earlier versions of browsers, before you
could use it.
So you should check for earlier versions of browsers, before you
could use it.
or just
if (window.screen) ColD = screen.colorDepth;
colorDepth in N4 isn't adapted for that purpose, returning
the # of bits available for composing a palette
color mode:_256_64K_16M
pixelDepth:___8__16__24
colorDepth:__18__16__24
'scuse the formatting
so a the better test would be
if (window.screen) {
ColD = screen.pixelDepth
? Math.pow( 2, screen.pixelDepth ) // in N4
: Math.pow( 2, screen.colorDepth ) // in E4
}
Michel
if (window.screen) ColD = screen.colorDepth;
colorDepth in N4 isn't adapted for that purpose, returning
the # of bits available for composing a palette
color mode:_256_64K_16M
pixelDepth:___8__16__24
colorDepth:__18__16__24
'scuse the formatting
so a the better test would be
if (window.screen) {
ColD = screen.pixelDepth
? Math.pow( 2, screen.pixelDepth ) // in N4
: Math.pow( 2, screen.colorDepth ) // in E4
}
Michel
screen.colorDepth
//Grdv