Peter Michaux wrote:
On 1/15/07, Daniel Eben Elmore <[EMAIL PROTECTED]> wrote:
>
> The Element.getStyle returns color values as RGB, I don't understand why and
> would really like a hex value instead. Do I have to convert it myself
> somehow?
Different browsers may return different formats. I think that in IE if
the background is set to "green" then currentStyle will return
"green". If the background is set to hex then hex will be returned. In
Firefox it will return RGB in both cases, I believe.
So for IE there is a requirement to implement a look-up table where
colour keywords have been used. The 17 CSS 2.1 colours are here:
<URL: http://www.w3.org/TR/CSS21/syndata.html#color-units >
IE's extended set of 140 named colours (which includes the 17 CSS 2.1
colours) are listed here (IE only page at MSDN):
<URL:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/colors/colors_name.asp
IE also allows the use of 28 different user-defined named system
colours, as well as 7 user-defined system colour combinations.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---