By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,229 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,229 IT Pros & Developers. It's quick & easy.

Why does background colour and font colour change when you change the windows settings?

P: n/a
Hi
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? 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?

thanks,
L
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Louise wrote:
<cut />
I understand that the windows scheme specifies the font and background
colours but does any one know how the IE browser picks this up? 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?


If a user has set their OS to use a certain colour scheme, particularly
an accessible one, shouldn't you be respecting their preference rather
than trying to override it?

If you've followed this W3C tip: http://www.w3.org/QA/Tips/color then
you shouldn't have to worry about a users OS/browser preferences making
some of your text disappear into any background colours.
--
Andrew Urquhart
- Reply: www.andrewu.co.uk/contact/
Jul 20 '05 #2

P: n/a
Els
Louise wrote:
Hi
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?
Haven't tried it, but I think most browsers pick it up. As
they also do pick up different widths for the scrollbar.
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?


I hope not.
If my eyesight would be so bad that I _need_ high contrast
black, I'd be real disappointed if the letters were purple
against this black background.

--
Els

Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #3

P: n/a
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/>
Jul 20 '05 #4

P: n/a
On Thu, 01 Apr 2004 12:50:40 +0100, Steve Pugh <st***@pugh.net> wrote:
lo**********@hotmail.com (Louise) wrote:


...
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.


The tradional answer to such worries is: always specify text color and
background color together in the same place.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #5

P: n/a
thanks for your responses, maybe I should explain my problem in a bit
more detail:
The problem is that I am using JavaHelp and the imbedded HTML viewer
does not seem to respect the Windows colour scheme, so my text
disappears.

I was trying to see if there was a way round this by understanding
more clearly how an IE browser or other picks up the colour scheme.

If any one has any advice on this that would be great, otherwise I am
going to have to have two sets of help files or style sheets!

thanks
L
Jul 20 '05 #6

P: n/a
thanks for your responses.
The problem is that I am using JavaHelp and the imbedded HTML viewer
does not seem to respect the Windows colour scheme, so my text
disappears.

I was trying to see if there was a way round this by understanding
more clearly how and IE browser or other picks up the colour scheme.

If any one has any advice on this that would be great, otherwise I am
going to have to have two sets of help files or style sheets!

thanks
L

Steve Pugh <st***@pugh.net> wrote in message news:<0f********************************@4ax.com>. ..
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

Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.