W3C home > Mailing lists > Public > www-style@w3.org > November 2001

Suggestion for Opacity (Was: RE: Opacity 0-1: Bad Idea?)

From: Christian Wolfgang Hujer <Christian.Hujer@itcqis.com>
Date: Sun, 11 Nov 2001 12:36:20 +0100
To: <www-style@w3.org>, "Kevin" <1@op.virtualave.net>
Cc: <dberansky@ucsd.edu>, <bzbarsky@MIT.EDU>, <jrexon@newsguy.com>
Message-ID: <000401c16aa5$15badb40$c62750d9@andromeda>
Hello Kevin,

(I think you are talking about Working Draft of CSS Level 3 Module Color

> -----Original Message-----
> Actually, I can see why Kevin might have thought so.  The spec says:
>    Any values outside the range 0.0 (fully transparent) to 1.0
>    (fully opaque) will be clipped to this range.
> using '0.0' and '1.0' instead of '0' and '1'. Strictly speaking, this
> implies that the precision is only to the first decimal position.

this depends on wether you are a professional programmer or not.

To explain to Kevin why Boris knows that any floating point value between
0.0 and 1.0 is allowed:

In most common programming languages, 0 differs from 0.0: 0 is an integer
number and 0.0 is a floating point number. This is the case in Java, C,
Objective C, C++, C#, Cluster, Perl, most dialects of Pascal, Modula and
Oberon, and in most Assembly languages. So for a programmer, "... 0.0 to 1.0
..." implies any floating point value between 0.0 and 1.0.

Of course W3C specs should also be clear to computer professionals that do
not program in one of these languages.

Since the W3C-Specs about CSS Level 3 are currently working drafts, I am
sure they will improve further and add a link that <alphavalue> is a
<number> ranging from 0.0 to 1.0, so when you take a look at <number>

3.2. Numbers
Number values can either be integer or real numbers. Integer values are
denoted by <integer> and real number values
are denoted by <number>. Integers and real numbers are specified in decimal
notation only. An <integer> consists of one or more digits "0" to "9". A
<number> can either be an <integer>, or it can be zero or more digits
followed by a dot (.) followed by one or more digits. Both integers and real
numbers may be preceded by a "-" or "+" to indicate the sign.
 Note that many properties that allow an integer or real number as a value
actually restrict the value to some range, often to a non-negative value.

So currently valid <alphavalue>s are: 0.0 0.00001 0.1246178 0.376134 0.79135
0.5 0.99134 1.0 0 1
And invalid <alphavalue>s are: -1 -1.0 -0.00001 -12 1341 134%

It is just the association, the link, between <alphavalue> and <number>
that's missing. These links will come since they are missing nearly
everywhere throughout CSS Level 3 Working Drafts. I'm sure they will come in
the next or following release.

And now the important part:

But I completely share Kevin's opinion that percentages in the range from 0%
to 100% should also be valid for <alphavalue>.
So <alphavalue> should allow a <number> in the range from 0.0 to 1.0 or
alternatively a <percentage> in the range from 0% to 100%.

What do you think?

Kind regards


Jan, just because some firms that develop web browsers are "not exact" there
is no reason for the W3C or web page authors to do the same and be unprecise
theirselves ;) And there are other fields of application for CSS than
delivering advertisements to customers. CSS is used by SVG, which again can
be embedded in Formatting Objects (XSL), which is ideal for professional
printing. Or one could use XML or HTML together with CSS for professional
printing. As you can see on http://www.w3.org/TR/REC-CSS2/page.html CSS
Level 2 already owns properties for page sizes, page breaks, page boxes and
even crop marks.

> Regards
> Dmitry
> On Sat, 10 Nov 2001, Boris Zbarsky wrote:
> > > Also, if you can only use 0 .1 .2 .3 .4 .... to- 1   and not
> things like =
> > > .13  for 13% then I believe this method is gonna be rather
> limiting in =
> > > the future.
> >
> > You can do 0.13
> >
> > Or 0.1354 if you so wish (assuming you can tell the difference between
> > 0.13 and that).
> >
> > It's just a floating-point value.
> >
> > Boris
Received on Sunday, 11 November 2001 06:37:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC