lo**********@hotmail.com (Louise) wrote:
I have written an HTML pages which does not have any colour specifying
tags as far I know. When I view this in an Microsoft internet
explorer browser it appears with a white background and black text but
when I change
Windows start menu->settings->control panel ->display -> appearance
and change scheme to 'High Contrast Black' the background in the
browser changes to black and the text to white.
I understand that the windows scheme specifies the font and background
colours but does any one know how the IE browser picks this up?
Because IE is part on Windows. Actually that's not the full answer as
NN4 also uses the Windows colour scheme, whilst Opera and NN7 don't.
But surely it makes sense for a Windows application to use the colour
scheme defined in the Windows settings? If the user has picked a hgh
contrast colour scheme then presumably they have good reason for doing
so and applications should respect that.
Also
is there any way of detecting the scheme change so that for instance
if the scheme chosen by the user is High contract Black I can change
my text to purple for instance?
Purple on black? Is that a good idea?
No, there's no way of detecting which Windows colour scheme is in use.
With some JavaScript you can find inidividual colours in use, e.g. teh
following returns the current body text colour in IE5+, NN6.1+ and
Opaer 7+. The only problem being that IE returns the colour in the
format #000000 whilst Opera and Gecko return it like rgb(0, 0, 0).
var pageColor;
if (document.body.currentStyle) {
pageColor = document.body.currentStyle.color;
} else if (document.defaultView &&
document.defaultView.getComputedStyle(document.bod y,"")){
pageColor =
document.defaultView.getComputedStyle(document.bod y,"").getPropertyValue("color");
}
I'm sure a JavaScript guru copuld improve the code somewhat.
And of course normal caveats about JavaScript not being available to
all users apply.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>