webcore 106 color handling changes
Dirk Mueller
mueller at kde.org
Thu Oct 30 12:30:40 CET 2003
On Saturday 25 October 2003 23:44, David Hyatt wrote:
> I may have made incompatible changes here, because perhaps I don't
> understand how QRgb works in Qt. In the Safari tree, we support the
> ability to specify rgba quadruples in CSS. This means that a color
> with an alpha component is perfectly valid and specifiable using CSS.
Ah I see. the amount of transparency support on our platform is very limited,
and its so slow in general that I think many people would just complain more
about the slowness than that they see a transparency effect. (yes you can
tune it with direct pixmap handling tricks and SSE(2) etc, but thats not
really in our scope for now.).
> Our QRgb is 32 bits, with 8 bits for each of the R, G, and B values,
> and another 8 bits for the alpha value. Looking at constructions like
> qAlpha, I assumed that's how Qt's QRgb works as well. Was I mistaken?
Thats how it works. note that qAlpha() == 0x00 means that the color is fully
transparent, and qAlpha() == 0xff that it is fully opaque. thats a weird
understanding of specifying alpha, but thats how it is.
so when it is fully transparent, it does not matter to me what values the r,g
and b fields have. they won't be visible at all. I agree that it is not nice
that a user could possibly now specify "inverted color" (which is needed for
outline support) by accident. But this allows us to implement a special color
that can be inherited (when I understand correctly then your border-color:
inherit; can not be explicitely inherited) and passes all the way correctly
through the style objects until it lands in the render tree.
the invalidColor was indeed a bad thing, I like your bool-solution better.
however, the other variants (defaultTextColor, invertedColor,
transparentColor) are imho simpler than the special casing you did with the
extra boolean.
> It's on my list of things to do in the Safari tree to eliminate the
> special-casing of transparent (i.e. ,the special bit in the bordervalue
> structure) and to just start testing for the transparent color instead.
Great.
--
> Looking for a KDE-related EMail-Alias ? Get one at kdemail.net for FREE! <
More information about the Khtml-devel
mailing list