Mozilla color question

T

Trefor

I'm using Mozilla 1.7.12 and have a question about colors
which do not seem to be correct. In the web page which
I am developing I have used tables to create a border
effect around objects. Within the table code I have :
bordercolor="saddlebrown" bordercolorlight="rosybrown"
This looks great against my chosen background in both
HTMLpad 2006 (my HTML editor program) and also in IE 1.6
the colors are displayed the same.
But under Mozilla or Firefox they are changed.
The rosybrown is no longer rosy but a light tan.
The saddlebrown is almost black.
Would specifying the color by number make any diff ?
I suspect not. I can't find any option to tell
Mozilla to stop that and use the colors defined.
What can a guy do now ????? Trefor
 
C

cwdjrxyz

Trefor said:
I'm using Mozilla 1.7.12 and have a question about colors
which do not seem to be correct. In the web page which
I am developing I have used tables to create a border
effect around objects. Within the table code I have :
bordercolor="saddlebrown" bordercolorlight="rosybrown"
This looks great against my chosen background in both
HTMLpad 2006 (my HTML editor program) and also in IE 1.6
the colors are displayed the same.
But under Mozilla or Firefox they are changed.
The rosybrown is no longer rosy but a light tan.
The saddlebrown is almost black.
Would specifying the color by number make any diff ?
I suspect not. I can't find any option to tell
Mozilla to stop that and use the colors defined.
What can a guy do now ????? Trefor

Use either hex numbers or r,g,b ones for colors, epecially those with
complex names. Name colors did not always work the same in the browser
war era, and some of them may well not today also. There likely was
never official standardization of many name colors by the W3C, and
these days this would not be very practical, as millions of colors now
are possible on modern browsers. You may have to experiment to get the
numbers for the shade of color you wish. There are various color charts
out there with numbers given, so you likely can get close to a color
and then just have to adjust it a bit. Some find r,g,b colors easier to
use for fine adjustments than hex ones, although hex ones are no more
difficult if you get used to counting in a hex number system.
 
J

Jonathan N. Little

Trefor said:
I'm using Mozilla 1.7.12 and have a question about colors
which do not seem to be correct. In the web page which
I am developing I have used tables to create a border
effect around objects. Within the table code I have :
bordercolor="saddlebrown" bordercolorlight="rosybrown"


<snip>

HTML attribute "bordercolorlight" & "bordercolor"?

This is ancient and IE specific stuff, that one reason you are having
trouble with Mozilla. Use CSS,

border, border-style, border-width, border-color ...

And like cwdjrxyz suggested use numeric color values in your stylesheet.
 
D

dorayme

Leonard Blaisdell said:
bordercolor and bordercolorlight are Microsoft only attributes.
The color descriptions saddlebrown and rosybrown are also Microsoft only.
Learn to author for the web, not Microsoft.
Here's a start:
<http://www.w3.org/TR/html401/> and
<http://www.w3.org/TR/CSS21/> when you get comfortable with the
information in the first link.
Best I can do.

leo

Yes, it is hard for us to do better for OP. But now, Windows folk
could get off their backsides, stop everything they are doing,
look up what saddlebrown is and propose a hex equiv... hey just a
minute, maybe I can too ... wonder if saddlebrown will appear in
Mac IE... hang on there Leo!

It appears! Of course. Mac IE is still good old MS. It is
"#8B4513"
 
L

Leonard Blaisdell

dorayme said:
It appears! Of course. Mac IE is still good old MS. It is
"#8B4513"

Since I'd never heard of such nonsense, I googled before replying to the
OP. If you google for saddlebrown, you will get both #fa8072 *and*
#8b4513. I really don't have much to say here anymore. I'm too far out
of the fight and weary of the easy pickin's. Although I did one tonight
:)

leo
 
C

cwdjrxyz

dorayme said:
Yes, it is hard for us to do better for OP. But now, Windows folk
could get off their backsides, stop everything they are doing,
look up what saddlebrown is and propose a hex equiv... hey just a
minute, maybe I can too ... wonder if saddlebrown will appear in
Mac IE... hang on there Leo!

It appears! Of course. Mac IE is still good old MS. It is
"#8B4513"

Powell's huge HTML tome gives:

saddlebrown = 8B4513 in hex and 139,69,19 in rgb.


rosybrown = BC8F8F in hex and 188,143,143 in rgb.
 
L

Leonard Blaisdell

"cwdjrxyz said:
Powell's huge HTML tome gives:
saddlebrown = 8B4513 in hex and 139,69,19 in rgb.
rosybrown = BC8F8F in hex and 188,143,143 in rgb.

Forgive me, but is Powell's book for authors of Microsoft products only?
A search for "Powell HTML" didn't throw up any hits from Google on their
front page. That's a bad sign. I didn't go further.

leo
 
B

Beauregard T. Shagnasty

Yes, it is hard for us to do better for OP. But now, Windows folk
could get off their backsides, stop everything they are doing,
look up what saddlebrown is and propose a hex equiv... hey just a
minute, maybe I can too ... wonder if saddlebrown will appear in
Mac IE... hang on there Leo!

It appears! Of course. Mac IE is still good old MS. It is
"#8B4513"

That it is. Search this page for "saddlebrown" and "rosybrown"
http://www.somacon.com/p142.php
 
C

cwdjrxyz

Leonard said:
Forgive me, but is Powell's book for authors of Microsoft products only?
A search for "Powell HTML" didn't throw up any hits from Google on their
front page. That's a bad sign. I didn't go further.

No, Powell's book is general. It is extremely long and shows much old
and new code including that for specific browsers as well as modern W3C
code. It has very extensive reference tables in the back of the book.

Thomas A. Powell, HTML & XHTML, fourth edition, 2003,
McGraw-Hill/Osborne, 932 pp. The information I quoted came from
Appendix E:Color ReferenceColor Names and Numerical Equivalents, pp.
829 - 835. This has been a best selling book in the US and the
well-known publisher has offices in many countries. Powell has been
writing books for years. He has taught in the computer science
department at UCSD which is a good university in California.
 
D

dorayme

Leonard Blaisdell said:
Since I'd never heard of such nonsense, I googled before replying to the
OP. If you google for saddlebrown, you will get both #fa8072 *and*
#8b4513. I really don't have much to say here anymore. I'm too far out
of the fight and weary of the easy pickin's. Although I did one tonight
:)

Hey Leo, you will cheer up when the weather gets warmer over
there. Don't give up, mate.

Being an experienced Mac user, you might appreciate the method I
used: used the keyword in html/css and opened in Mac IE. Fired up
the Mac Digital Color Meter that comes with Tiger and ran the
eyedropper over it and Command Shift C. This copies the color to
the clipboard. It is very handy generally.

Side issue for Mac obsessives only: It pastes with the quotes and
no semicolon, this particular format is a damn nuisance as you
are then obliged to strip one or both the quotes and add the semi
depending on the situation. If it is an inline style use and at
the end of a string of directives, you can leave the end
quotes!). When I am using it a lot, I get to think I should look
into a macro or applescript or something to auto do this job.
Makes me wonder why it pastes in this format in the first place?
What were they thinking, that you might be using it to quote some
colour reference someone else made? Even then it it is not quite
right but getting closer.

Let me write a little excerpt of a possible play to cheer you up
Leo:

Former geeky lover writes in his autobiography:

In my long life there was but one woman that I truly loved, the
only one to pierce right through to the inner chambers of my
heart. I still feel the keen edge of her loveliness. We were set
to marry. And then I was called to war. I wrote regularly from
the trenches. Finally, I was wounded and to be sent home. I wrote
one more time. I talked about how I longed to see her, how tender
and raw was my anticipation, and about how i longed to see her
blushing cheeks - except I did not use "blushing". I used
"#F5D4FC"!

She made the decision to leave me the moment she read this. I
ended up hexing myself.
 
T

Trefor

dorayme said:
Hey Leo, you will cheer up when the weather gets warmer over
there. Don't give up, mate.

Being an experienced Mac user, you might appreciate the method I
used: used the keyword in html/css and opened in Mac IE. Fired up
the Mac Digital Color Meter that comes with Tiger and ran the
eyedropper over it and Command Shift C. This copies the color to
the clipboard. It is very handy generally.

Side issue for Mac obsessives only: It pastes with the quotes and
no semicolon, this particular format is a damn nuisance as you
are then obliged to strip one or both the quotes and add the semi
depending on the situation. If it is an inline style use and at
the end of a string of directives, you can leave the end
quotes!). When I am using it a lot, I get to think I should look
into a macro or applescript or something to auto do this job.
Makes me wonder why it pastes in this format in the first place?
What were they thinking, that you might be using it to quote some
colour reference someone else made? Even then it it is not quite
right but getting closer.

Let me write a little excerpt of a possible play to cheer you up
Leo:

Former geeky lover writes in his autobiography:

In my long life there was but one woman that I truly loved, the
only one to pierce right through to the inner chambers of my
heart. I still feel the keen edge of her loveliness. We were set
to marry. And then I was called to war. I wrote regularly from
the trenches. Finally, I was wounded and to be sent home. I wrote
one more time. I talked about how I longed to see her, how tender
and raw was my anticipation, and about how i longed to see her
blushing cheeks - except I did not use "blushing". I used
"#F5D4FC"!

She made the decision to leave me the moment she read this. I
ended up hexing myself.
Cute story .... cute. You have a talent there. Trefor
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

Trefor wrote :
I'm using Mozilla 1.7.12 and have a question about colors
which do not seem to be correct. In the web page which
I am developing I have used tables to create a border
effect around objects. Within the table code I have :
bordercolor="saddlebrown" bordercolorlight="rosybrown"

saddlebrown and rosybrown are CSS 3 colors (section 4.3) but bordercolor
and bordercolorlight are proprietary HTML extensions, are non-standard.
Why not use web standards and validate your webpage instead?

HTML validator: http://validator.w3.org/

CSS validator: http://jigsaw.w3.org/css-validator/
Would specifying the color by number make any diff ?
I suspect not. I can't find any option to tell
Mozilla to stop that and use the colors defined.
What can a guy do now ????? Trefor

Using valid markup code and valid CSS code will make a difference.
Recent Mozilla releases (stable releases) and Firefox 1.5+ support CSS 3
color module. So, that's not the problem with your webpage. The problem
with your webpage is use of proprietary (Microsoft) and non-standard
HTML extension instead of using valid standard markup code.

Gérard
 
T

Toby Inkster

Gérard Talbot said:
Recent Mozilla releases (stable releases) and Firefox 1.5+ support CSS 3
color module.

The named colours in CSS 3 are supported by most browsers, regardless of
overall support for CSS. Certainly IE 4, Opera 5 and Netscape 4.x support
them.
 
T

Toby Inkster

Leonard said:
The color descriptions saddlebrown and rosybrown are also Microsoft only.

No they're not. They're names taken from the X11 (UNIX) colour system.

Netscape, who invented the <FONT> element and most of the early
presentational HTML (much of which found its way into the HTML 3 and HTML
4 standards), based its colours on the X11 system. This has about 140
named colours.

This colour scheme was picked up by all the major browsers, though it has
taken quite some time to make its way into any official web standards (SVG
1.0, CSS 3.0). (Note that these standards also added grey as a synonym for
gray, including all its variants -- dimgrey, lightgrey, etc.)

So while it is non-standard and supported by Microsoft's web browser, it
is *not* Microsoft only, and was not even invented by Microsoft.

If anyone needs to look up any X11 colour values, then may I humbly offer
up:

http://buzzword.org.uk/colours/

which is a colour calculator for blending multiple colours. It will
accept, and can return X11 named colours.
bordercolor and bordercolorlight are Microsoft only attributes.

That is true I believe. Certainly they're not part of any standard.
 
J

Jukka K. Korpela

Scripsit Toby Inkster:
Netscape, who invented the <FONT> element and most of the early
presentational HTML (much of which found its way into the HTML 3 and
HTML 4 standards), based its colours on the X11 system. This has
about 140 named colours.

Named colors should never have been taken into HTML (or CSS). Someone might
say that black and white would be OK, but they can easily be written as #000
and #fff in the short CSS notation (and even shorter notations could have
been defined, allowing #0 and #f).

The existence of color names makes authors use these colors, most of which
are generally unsuitable in web authoring. This applies particularly to
those colors that have been defined in HTML and CSS specifications, such as
red, blue, and yellow. They are far too strong for most sensible purposes.

The right thing to do use to use color charts or color design utilities that
let you compare and tune your colors and produce their hex code numbers.
(Note that these standards also added grey as a
synonym for gray, including all its variants -- dimgrey, lightgrey,
etc.)

Strangely enough, IE (both 6 and 7) refuses to recognize grey. This is of
course the only right thing to do according to existing CSS specifications:
a declaration with an unknown (by the spec) keyword _shall_ be ignored.
 
C

cwdjrxyz

Toby said:
The named colours in CSS 3 are supported by most browsers, regardless of
overall support for CSS. Certainly IE 4, Opera 5 and Netscape 4.x support
them.

Although using hex colors rather than named colors seems a better
choice to many, there are situations when using the r,g,b notation has
many advantages. For example, if you are operating on color values with
some function, you may have to use a hex/base10 conversion, while if
you use r,g,b you can avoid this conversion.

To give a very early example from 1996, hex color values are being
operated on by a script that changes the text color as a function of
positions of letters in the text. The script portions of this very
ancient example are given below, and notice the hex/base10 conversion
that has to be used.

_________________________________________________________________

// Michael P. Scholtis ([email protected])
// All rights reserved. January 15, 1996
// You may use this JavaScript example as you see fit, as long as the
// information within this comment above is included in your script.


function MakeArray(n){
this.length=n;
for(var i=1; n>=i; i++) this=i-1;
return this
}

hex=new MakeArray(16);
hex[11]="A"; hex[12]="B"; hex[13]="C"; hex[14]="D"; hex[15]="E";
hex[16]="F";

function ToHex(x){ // Changes a int to hex (in the range 0
to 255)
var high=x/16;
var s=high+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
high=parseInt(s,10); //3
var left=hex[high+1]; // left part of the hex-value
var low=x-high*16; // calculate the rest of the values
s=low+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
low=parseInt(s,10); //3
var right=hex[low+1]; // right part of the hex-value
var string=left+""+right; // add the high and low together
return string;
}

function rainbow(text){
text=text.substring(3,text.length-4); // gets rid of the
HTML-comment-tags
color_d1=255; // any value in 'begin'
0 to 255
mul=color_d1/text.length;
for(i=0;text.length > i;i++){
color_d1=255*Math.sin(i/(text.length/3)); // some other things
you can try >> "=255-mul*i" to fade out, "=mul*i" to fade in, or try
"255*Math.sin(i/(text.length/3))"
color_h1=ToHex(color_d1);
color_d2=mul*i;
color_h2=ToHex(color_d2);
document.write("<font
color='FF"+color_h1+color_h2+"'>"+text.substring(i,i+1)+"<\/font>");
}
}

// --End Hiding Here -->

<!--
{rainbow("--> This is a rainbow text effect which you may upload to
your own site and use as you wish. Unfortunately you can only add about
10 lines of text here and then you have to use the code over again in
the next paragraph. You only need to use the code that's in the body
tag over again, not the part in the head tag. Let's see what happens
here if I continue to add text and see if it continues to change the
color of the text. And I'll just ramble on here a little more so you
can see the effect here and how it changes the text color. Cool effect
Huh! <!--");}
//-->

__________________________________________________________________________

Now if you use r,g,b notation and some modern html including the span
tag, you can avoid the hex/base10 conversion and greatly decrease the
code needed. See what about 10 years of progress in html allows at
http://www.cwdjr.net/text/rainbow_text.html by viewing the source code.

Since writing a color in r,g,b takes a few more key strokes than using
hex, many seldom, if ever, use r,g,b. However it is well worth
remembering it if hex color will result in the need for a hex/base10
conversion.

The example given seems very dated now. All we need is a midi and
several animated gifs to give the full flavor of this long-gone era.
 
T

Toby Inkster

cwdjrxyz said:
function MakeArray(n){
this.length=n;
for(var i=1; n>=i; i++) this=i-1;
return this
}

hex=new MakeArray(16);
hex[11]="A"; hex[12]="B"; hex[13]="C"; hex[14]="D"; hex[15]="E";
hex[16]="F";

function ToHex(x){ // Changes a int to hex (in the range 0
to 255)
var high=x/16;
var s=high+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
high=parseInt(s,10); //3
var left=hex[high+1]; // left part of the hex-value
var low=x-high*16; // calculate the rest of the values
s=low+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
low=parseInt(s,10); //3
var right=hex[low+1]; // right part of the hex-value
var string=left+""+right; // add the high and low together
return string;
}


You base your entire argument on the "fact" that converting from decimal
to hexadecimal in Javascript is hard. It's not.

var r = 196; // red value in decimal
var g = 128; // green value in decimal
var b = 255; // blue value in decimal
var total = (256*256*r) + (256*g) + b; // combine
var hexcolour = "#" + total.toString(16); // ToHex

Your rainbow script, using hexadecimal notation is:

function paint(blah)
{
c1=255; x=blah.length; f=c1/x; c0=255;
for (i=0;x>i;i++)
{
c1=Math.round(255*Math.sin(i/(x/3)));
c2=Math.round(f*i);
total = (256*256*c0) + (256*c1) + c2;
hexcolour = "#" + total.toString(16);
document.write('<span style="color:' + hexcolour + '">'
+ blah.substring(i,i+1) + '<\/span>');
}
}

Easy.
 
T

Toby Inkster

Jukka said:
Named colors should never have been taken into HTML (or CSS). Someone might
say that black and white would be OK, but they can easily be written as #000
and #fff in the short CSS notation (and even shorter notations could have
been defined, allowing #0 and #f).

I'd certainly agree. I tend to use 'black' and 'white' for legibility, and
occasionally 'lime' for backgrounds and borders when debugging; but I'd
have no objection to them all being phased out in a future spec.

Hexadecimal notation gives you a far wider palette, plus it's actually
*easier*. Who knows what shade 'moccasin' is? It would need to be looked
up by anyone but the most ardent orchid experts, but anyone with a
modest knowledge of the hexadecimal colour space could tell from a
glance that #FFE4B5 is a pale yellowish-orange.
 
C

cwdjrxyz

Toby said:
cwdjrxyz said:
function MakeArray(n){
this.length=n;
for(var i=1; n>=i; i++) this=i-1;
return this
}

hex=new MakeArray(16);
hex[11]="A"; hex[12]="B"; hex[13]="C"; hex[14]="D"; hex[15]="E";
hex[16]="F";

function ToHex(x){ // Changes a int to hex (in the range 0
to 255)
var high=x/16;
var s=high+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
high=parseInt(s,10); //3
var left=hex[high+1]; // left part of the hex-value
var low=x-high*16; // calculate the rest of the values
s=low+""; //1
s=s.substring(0,2); //2 the combination of these are the
same as the trunc function
low=parseInt(s,10); //3
var right=hex[low+1]; // right part of the hex-value
var string=left+""+right; // add the high and low together
return string;
}


You base your entire argument on the "fact" that converting from decimal
to hexadecimal in Javascript is hard. It's not.


No, I base my argument on the fact that converting from decimal to
hexadecimal is not needed at all if you use the r,g,b notation. Other
applications may not be quite as simple as the very simple example used
here. It is somewhat like selecting the "natural" coordinate system for
math calculations. For example, it is sometimes fairly simple to
calculate functions that involve a circle or sphere with ordinary
cartesian coordinates. However using the natural coordinates for a
circle, polar coordinates, often makes the equations more
compact,elegant, and easier to handle. Of course the old 1996 script
likely used a more complicated hex/decimal conversion than was needed
for the simple problem; however I do not know enough about the status
of script and html in 1996 to know for sure if this was the case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top