Closed Bug 273831 Opened 20 years ago Closed 20 years ago

elements appear green when the opacity property is set

Categories

(Core :: Web Painting, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jleedev, Assigned: roc)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Epiphany/1.4.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Epiphany/1.4.6

When you set the opacity property of an element, it turns green. In an image or
div that has a light background, the background takes a greenish tint. Text gets
a green "halo" where the anti-aliasing occurs. Screenshot and testcase to come.

The effect is most pronounced when opacity is low, like 0.1.

I suspect this is a Linux-only bug, but haven't tried any other platforms.

Reproducible: Always
Steps to Reproduce:
Attached file A simple testcase.
Attached image Screenshot
Screenshot of attachment #168266 [details]
This worksforme with a current Linux trunk build....

Josh, what X server (product and version) are you using?  What's your bit depth
set to?
I've figured it out. I was running in 16 bits of color. Changing it to 24 fixes
this.

But when running in low color depths, why do very light grays turn funny colors?
Using xmag to inspect the pixels shows that they actually have a different green
component than red and blue.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
When you have 16 bits to divide amongst 3 colors (red, green, blue), something
has to give.  Red and blue get 5 bits each, green gets 6.

That means that the green component is accurate to the nearest 8 (since we want
to express the 0-255 range in 6 bits), while the red and blue components are
accurate to the nearest 16.  As a result, a gray of, say rgb(40, 40, 40) will
get painted as rgb(32, 40, 32), if I understand this code correctly...

See http://lxr.mozilla.org/seamonkey/source/gfx/src/nsBlender.cpp#286 (comment
and function following) for the gory details.
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: