HighDots Forums  

Hexadecimal colour notation (was: Re: Attach event/function to linkswithin span tag)

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Hexadecimal colour notation (was: Re: Attach event/function to linkswithin span tag) in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Winter
 
Posts: n/a

Default Hexadecimal colour notation (was: Re: Attach event/function to linkswithin span tag) - 01-23-2006 , 09:33 AM






[Cross-posted to c.i.w.a.stylesheets. Follow-ups set to same.]

On 22/01/2006 22:01, Thomas 'PointedEars' Lahn wrote:

Quote:
Michael Winter wrote:
[snip]

Quote:
[...] The three-digit RGB notation (#rgb) is converted into
six-digit form (#rrggbb) by replicating digits, [...]. This
ensures that white (#ffffff) can be specified with the short
notation (#fff) and removes any dependencies on the color
depth of the display.
-- 4.3.6 Colors, CSS 2 Specification

That seems to make it rather clear that #00f and #0000ff specify
the same colour.

Iff the color depth of the display device allows that,
No, not at all. They are /always/ the same. The representation of a
particular colour value may differ between devices, but #bad and
#bbaadd, for example, /must/ be rendered as the same colour on the same
device.

Quote:
hence the remark on the dependency of the color depth of the display
that is removed by using it instead of the six-digit form.
I think you are reading that in a different way than what was intended.
The first sentence of the quote describes the conversion between the
three- and six-digit notation, and that it is performed by digit
replication (#00f -> #0000ff) rather than the addition of zeros (#00f ->
#0000f0). The second sentence (third, including the omitted example)
then explains why this choice is preferable.

Consider the implications of the alternative conversion. If #fff was
expanded using zeros, it would become #f0f0f0. At low colour depths,
this would undoubtedly be mapped to white (#ffffff), but at higher
colour depths, it could rendered as-is. That is, this form of conversion
will produce results that will depend on the colour depth of a given
display.

[snip]

Quote:
You seem to have muddled your terminology. Are you referring to the
onload attribute (HTML) or the onload property (OM)?
[snip]

Quote:
Sorry for causing confusion, yet I think I had been clear enough.
No, you hadn't otherwise I wouldn't have referred to the unavailability
of the BODY element in the document tree in a previous post.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.


Reply With Quote
  #2  
Old   
VK
 
Posts: n/a

Default Re: Hexadecimal colour notation (was: Re: Attach event/function to links within span tag) - 01-23-2006 , 11:10 AM







Michael Winter wrote:
Quote:
[...] The three-digit RGB notation (#rgb) is converted into
six-digit form (#rrggbb) by replicating digits, [...]. This
ensures that white (#ffffff) can be specified with the short
notation (#fff) and removes any dependencies on the color
depth of the display.
-- 4.3.6 Colors, CSS 2 Specification

The quoted part of CSS specification (and #FFF issue in whole) is
targeted to Safe Palette (216 color) where each R, G and B value is
represented as 00, 11, 22 ... FF

It is nice to know and remember the Safe Palette (it shows your good
skills) but it's practical value as of 2006 A.D. is zero. My cellphone
browser supports 64,000 colors!

The quoted part from W3C addresses an issue of a browser with CSS2
support but able to display only 256 colors. Theoretically possible,
practically irrelevant.

For who's interested: you can also read the position over this question
of Lynda Weinman, the inventor of Safe Palette concept:
<http://www.lynda.com/hex.asp>

And here is the original Safe Palette as it was first introduced for
web developers:
<http://www.lynda.com/hexpalette/images/nhue2.gif>



Reply With Quote
  #3  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 12:21 PM



Michael Winter wrote:

Quote:
On 22/01/2006 22:01, Thomas 'PointedEars' Lahn wrote:
Michael Winter wrote:
[...] The three-digit RGB notation (#rgb) is converted into
six-digit form (#rrggbb) by replicating digits, [...]. This
ensures that white (#ffffff) can be specified with the short
notation (#fff) and removes any dependencies on the color
depth of the display.
-- 4.3.6 Colors, CSS 2 Specification

That seems to make it rather clear that #00f and #0000ff specify
the same colour.
Iff the color depth of the display device allows that,

No, not at all. They are /always/ the same.
They are not always the same.

Quote:
The representation of a particular colour value may differ between
devices, but #bad and #bbaadd, for example, /must/ be rendered as the
same colour on the same device.
You are missing the point. If the display device does not run with a color
depth of 24 bit (16'777'216 colors) or more, it _cannot_ display the color
#bbaadd (12'298'973) the same way as if it was a display device that ran
with such a color depth using the same color components. The specification
says "[The three-digit RGB notation] [...] removes any dependencies on the
color depth of the display" for a reason. The reason is that #bbaadd
depends on the color depth of the display device, while #bad
[(round(11/15*m), round(10/15*m), round(13/15*m)); m := max(2^color_depth
- 1, 255)] does not. You will notice that with m == 255, the color
components are the same with the three-digit and the six-digit notation;
hence the notion of "replicating digits" which is in fact an adaption to
the available color component range and so to the available range of color
numbers.


PointedEars


Reply With Quote
  #4  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 12:24 PM



VK wrote:

Quote:
Michael Winter wrote:
[...] The three-digit RGB notation (#rgb) is converted into
six-digit form (#rrggbb) by replicating digits, [...]. This
ensures that white (#ffffff) can be specified with the short
notation (#fff) and removes any dependencies on the color
depth of the display.
-- 4.3.6 Colors, CSS 2 Specification


The quoted part of CSS specification (and #FFF issue in whole) is
targeted to Safe Palette (216 color) where each R, G and B value is
represented as 00, 11, 22 ... FF
No, it is not targeted at that at all. And with the Web-Safe Palette,
to get those 216 distinct colors, each color component must be 00, 33,
66, 99, CC or FF. Again you have no clue what you are talking about.


PointedEars


Reply With Quote
  #5  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 12:30 PM



Thomas 'PointedEars' Lahn wrote:

Quote:
[...] The specification says "[The three-digit RGB notation] [...]
removes any dependencies on the color depth of the display" for a reason.
The reason is that #bbaadd depends on the color depth of the display
device, while #bad [(round(11/15*m), round(10/15*m), round(13/15*m));
m := max(2^color_depth - 1, 255)] does not.
^^^
That's min(), not max(), of course.


PointedEars


Reply With Quote
  #6  
Old   
VK
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 12:48 PM




Thomas 'PointedEars' Lahn wrote:
Quote:
You are missing the point. If the display device does not run with a color
depth of 24 bit (16'777'216 colors) or more, it _cannot_ display the color
#bbaadd (12'298'973) the same way as if it was a display device that ran
with such a color depth using the same color components. The specification
says "[The three-digit RGB notation] [...] removes any dependencies on the
color depth of the display" for a reason. The reason is that #bbaadd
depends on the color depth of the display device, while #bad
[(round(11/15*m), round(10/15*m), round(13/15*m)); m := max(2^color_depth
- 1, 255)] does not. You will notice that with m == 255, the color
components are the same with the three-digit and the six-digit notation;
hence the notion of "replicating digits" which is in fact an adaption to
the available color component range and so to the available range of color
numbers.
If you decided to be CSS expert also, than please study Safe Palette
and other palette ussues from reputable sources. The best is Lynda
Weimann's at <http://www.lynda.com> W3C is *not* a reputable source in
this question because the majority of its members have no clue about
practical web-design and web-development. This cluelessness is (for
instance) being demonstrated in the the mentioned CSS2 paragraph.
Safe Palette consists of * 216 * colors, not 256: because even withing
0-255 range 40 colors are platform dependent (Mac/Windows).

Whoever wrote the quoted CSS2 paragraph must be knew *something* about
Safe Palette, but not enough to get the picture right. She must be
decided that Safe Palette simply consists of colors like FF DD EE (thus
R,G,B values are represented in paired hex's) and that "all" such
colors can degrade properly on low displays.

Nothing of it is true, so stop trying to find some meaningful
interpretation to this text.

And once over: staying *now* within 216 colors of Safe Palette of
course is not an error, but has no practical value.



Reply With Quote
  #7  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 01:21 PM



VK wrote:

Quote:
If you decided to be CSS expert also, than please study Safe Palette
and other palette ussues from reputable sources. [...]
I refer you to news:5623833.npy78V61md (AT) PointedEars (DOT) de
and let the rest of your nonsense speak for itself.

<URL:http://www.w3.org/Consortium/>


PointedEars


Reply With Quote
  #8  
Old   
VK
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-23-2006 , 02:00 PM




Thomas 'PointedEars' Lahn wrote:
Quote:
I refer you to news:5623833.npy78V61md (AT) PointedEars (DOT) de
and let the rest of your nonsense speak for itself.
This post speaks (as well as the relevant W3C paragraph) but not in the
way you want. It just shows that both sources have no idea about Safe
Palette

Every of 216 Safe Palette colors has hex form of XX YY ZZ

But *not* every color having form of XX YY ZZ is a Safe Color

CSS2 comment is based on the wrong idea of what Safe Colors are.
Actually the whole shortcut standard (#FFF instead of #FFFFFF) is
originated from the wrong idea of what Safe Colors are. It is clear (to
me at least) that the reasonning was to imply #FFF syntacs which by
itself should ensure only Safe Colors in the used palette. Again - it
is completely wrong and just show the ignorance of involved W3C
members.

As we started on Safe Colors, I cannot skip on opportunity to quote
Safe Colors' inventor Lynda Weinman. 10 years after people starting to
think that Safe Colors "were always here" or (which is even more
terrible) that Safe Colors Palette was invented by W3C for the good of
humanity :-)

<http://www.lynda.com/hex.asp>
....
The browser-safe palette was developed by programmers with no design
sense, I assure you. That's because a designer would have never picked
these colors. Mostly, the palette contains far less light and dark
colors than I wish it did, and is heavy on highly saturated colors and
low on muted, tinted or toned colors.
....
The Browser-Safe Palette, as I so named it, is the actual palette that
Mosaic, Netscape, and Internet Explorer use within their browsers. The
palettes used by these browsers are slightly different on Macs and PCs.
This palette is based on math, not beauty. I didn't and wouldn't have
picked the colors in this palette, but Netscape, Mosaic, and Internet
Explorer did, so....
....
The only reason to use the browser-safe palette is if you have a
concern that your Web design work will be viewed from a 256 color
(8-bit) computer system. When I published the browser-safe color chart
in my first book, Designing Web Graphics, waaaayyy back in 1996, the
MAJORITY of computer users had 8-bit video cards. Today, the minority
have them, so the justification for using the browser-safe palette has
diminished greatly if you are developing your site for users who have
current computer systems.
....
Though this might seem blasphemous to older readers of my books, or
loyal website visitors, I believe it's safe to design without the
palette. I believe this because so few computer users view the web in
256 colors anymore.
....
Conversely, there's no harm in using the browser-safe palette either.
It simply limits your choices to 216 colors. Most people don't have a
lot of color picking confidence, and working with limited color choices
is easier. At this point, there's no right or wrong when it comes to
which colors you pick, but more important to know how to combine colors
in pleasing and effective ways.



Reply With Quote
  #9  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Hexadecimal colour notation (was: Re: Attach event/function to links within span tag) - 01-24-2006 , 12:49 AM



On 2006-01-23, VK <schools_ring (AT) yahoo (DOT) com> wrote:
Quote:
Michael Winter wrote:
[...] The three-digit RGB notation (#rgb) is converted into
six-digit form (#rrggbb) by replicating digits, [...]. This
ensures that white (#ffffff) can be specified with the short
notation (#fff) and removes any dependencies on the color
depth of the display.
-- 4.3.6 Colors, CSS 2 Specification


The quoted part of CSS specification (and #FFF issue in whole) is
targeted to Safe Palette (216 color) where each R, G and B value is
represented as 00, 11, 22 ... FF
Atually IIRC only the digits 0,3,6,9,C,F

--

Bye.
Jasen


Reply With Quote
  #10  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Hexadecimal colour notation - 01-24-2006 , 01:11 AM



On 2006-01-23, VK <schools_ring (AT) yahoo (DOT) com> wrote:
Quote:
Thomas 'PointedEars' Lahn wrote:
You are missing the point. If the display device does not run with a color
depth of 24 bit (16'777'216 colors) or more, it _cannot_ display the color
#bbaadd (12'298'973) the same way as if it was a display device that ran
with such a color depth using the same color components. The specification
says "[The three-digit RGB notation] [...] removes any dependencies on the
color depth of the display" for a reason. The reason is that #bbaadd
depends on the color depth of the display device, while #bad
[(round(11/15*m), round(10/15*m), round(13/15*m)); m := max(2^color_depth
- 1, 255)] does not. You will notice that with m == 255, the color
components are the same with the three-digit and the six-digit notation;
hence the notion of "replicating digits" which is in fact an adaption to
the available color component range and so to the available range of color
numbers.

If you decided to be CSS expert also, than please study Safe Palette
and other palette ussues from reputable sources. The best is Lynda
Weimann's at <http://www.lynda.com> W3C is *not* a reputable source in
this question because the majority of its members have no clue about
practical web-design and web-development. This cluelessness is (for
instance) being demonstrated in the the mentioned CSS2 paragraph.
Safe Palette consists of * 216 * colors, not 256: because even withing
0-255 range 40 colors are platform dependent (Mac/Windows).
I think it was mor an issue of 6^3 < 256 and I'm sure win 3.1 let me define
more than 40 custom colours.

Quote:
Whoever wrote the quoted CSS2 paragraph must be knew *something* about
Safe Palette, but not enough to get the picture right. She must be
decided that Safe Palette simply consists of colors like FF DD EE (thus
R,G,B values are represented in paired hex's) and that "all" such
colors can degrade properly on low displays.
it's not about safe pallette it's about dynamic range

if a 12 bit palette #FFF was promoted to 24 bit by simply multiplying each
element by 16 (0x10) the dynamic range wopuld suffer #F0F0F0 (a kind of
dirty snow colour) would be the whitest available.

Bye.
Jasen


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.