Jump to content

extra digits on color value: transparency?


dglp

Recommended Posts

I have recently come across some instances of 8-digit color values, such as #FFFFFF01. They seem to specify some sort of transparency, yet I don't see anything about it in the discussion of color settings. Can someone point me to a description?:)

Link to comment
Share on other sites

I've never heard of that - even in CSS3 opacity is still defined by the opacity: property.Quickly searching the web, apparently XAML can understand the 8-hexadigit notation: http://msdn2.microsoft.com/en-us/library/ms752059.aspxBut that's MS technology, so...

Link to comment
Share on other sites

Synook,it does the same thing in IE and Firefox. It must have some purpose, but the effect is to disable whatever color is specified by the previous six digits.In the following example

  .tbl {	background-color: #FFFFFF01;	font-weight: bold;

a black background turns to white (default color). But why have a color specification at all if that's all it does? :)

Link to comment
Share on other sites

It must have some purpose, but the effect is to disable whatever color is specified by the previous six digits.
It isn't valid in CSS 2 or 3. It "disables" the previous digits because it renders the property invalid :)Use opacity: and filter:alpha(opacity=xx) to define opacity.By the way, in the XAML specification it is actually the first two hexadigits that define opacity.
Link to comment
Share on other sites

So is the eight digit value definitely about opacity/transparency?I'm still not clear what they're meant to do.I didn't find the reference at the XAML siteIf someone has set up a style sheet using those values, is it1) out of date, e.g. CSS12) IE only3) some other reason

It isn't valid in CSS 2 or 3. It "disables" the previous digits because it renders the property invalid :)Use opacity: and filter:alpha(opacity=xx) to define opacity.By the way, in the XAML specification it is actually the first two hexadigits that define opacity.
Link to comment
Share on other sites

So is the eight digit value definitely about opacity/transparency?I'm still not clear what they're meant to do.
Mhmm - the first two hexadigits define opacity (from 00 totally transparent to FF totally opaque), and the rest are in standard RRGGBB format.
If someone has set up a style sheet using those values, is it1) out of date, e.g. CSS12) IE only3) some other reason
Probably 3: confused HTML/CSS with XAML, but maybe they had another reason (e.g. CSS interpreted by JS). Do you have an example?
I didn't find the reference at the XAML site
Maybe this page explains it better: http://silverlight.net/quickstarts/silverl...10/drawing.aspx (or rather, it shows an example under "painting with solid colors with a SolidColorBrush")
Link to comment
Share on other sites

Do you have an example?
This page is a table generated by PHP Generator for MySQL.The CSS is in the head, and if you look at the style declarations for any of several classes, you'll see the 8-digit form in use.
  .tbl {	background-color: #FFFFFF01;  }  a:link { 	background-color: #FFFFFF01;	color: #006400;	font-family: Arial;	font-size: 12px;  }  a:active { 	color: #0000FF;	font-family: Arial;	font-size: 12px;  }  a:visited { 	background-color: #FFFFFF01;	color: #006400;	font-family: Arial;	font-size: 12px;

Link to comment
Share on other sites

Well, i don't know why it does that, but obviously it doesn't work :)Trust me, 8-hexadigit color values have never been part of CSS 1, 2 or 3.

Link to comment
Share on other sites

Well, i don't know why it does that, but obviously it doesn't work :mellow:Trust me, 8-hexadigit color values have never been part of CSS 1, 2 or 3.
Imagine that... someone writing a bit of code that does nothing. :) It's humorous in a way, like the deliberate creation of an error in an otherwise perfect work of art. Beauty marks, as it were. It makes me wonder how many programmers go through life adding bits of useless code for its own sake. Deep. Very deep. :)
Link to comment
Share on other sites

Well maybe the people at SQL Maestro are XAML guys venturing into HTML?

Link to comment
Share on other sites

Well maybe the people at SQL Maestro are XAML guys venturing into HTML?
I'm starting to do some work in XAML at the moment and I noticed the 8 digit hex colours the other day. Threw me for a while until I worked out that the first two digits were for the opacity. You can sort of see the sense in doing that (it's quite an elegant solution) but why you'd do that for HTML and CSS when it doesn't support them ... *shrugs*
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...