Basically, using '0x000000' in CSS was a kludge, non-standard, and
probably should have been documented as such. It will cause a
deprecation warning.
Any of the other 3 methods are standard, acceptable, and work.
It would be fine with me if we just said that you specified colors the
same as the CSS standard.
You can specify your color as a numeric value also, the result of a
computation, it doesn't need to be expressed as a hex constant.
On 2008-11-13, at 08:49EST, Lou Iorio wrote:
The text preceding Example 20.3. Coloring text using CSS seems to
completely contradict what the example shows.
The text says:
OpenLaszlo enables coloring in four ways: 0x000000, #000000,
rgb(0,0,0), and "black". For now, the best reason to prefer to use
the hex style 0x000000 is that it always works, whether the color is
assigned explicitly within the view, or by stylesheet. Color
assignment by stylesheet fails by name, #hex, or rgb(). Explicit
color assignment by rgb() fails unless the RGB values are all
numerals -- that is, rgb(0,0,0) produces black, but rgb(FF,FF,FF),
which should produce white, comes back at compile time as an invalid
color.
Coloring of text with fgcolor="foo" is enabled in the same fashions,
but with the same limitations.
CSS spits out an error if you use 0x000000. How about:
OpenLaszlo enables coloring in four ways: 0x000000, #000000,
rgb(0,0,0), and "black". Using the format 0x000000 only works for
explicit assignment; it does not work in CSS. Color assignment using
rgb() must be specified with decimal values from 0 - 255.
Coloring of text with fgcolor="foo" is enabled in the same fashions,
but with the same limitations.
In addition, the title of the example, "Coloring text using CSS",
might be better if changed to "Applying color explictly and with
CSS" since it shows coloring views as well as text.
If you agree (or have a better idea), I'll make the changes.
Lou