Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML colors look different than SWF colors

Dreamweaver & Flash

HTML colors look different than SWF colors

by  raymondbirch  Posted    (Edited  )
If you set a SWF's background color to the same background color as an HTML page, the colors may not always match on all machines.

In particular, you're more likely to see a slight difference on 16-bit monitors, set to display at "thousands of colors". That's because a 16-bit monitor can't display as many colors as other monitors, and different renderers may round colors in different ways.

Reason:
It sounds paradoxical, but monitors set to "hundreds of colors" have a wider range than those set to "thousands". Although a 16-bit display can show more simultaneous colors, the palletized image can choose from a wider range of colors.

The math shows why:
32-bit monitors and 8-bit palettes both use a full byte of information for the red, green, and blue channels. That's 256 possible values for each of three colors. But a 16-bit monitor has only two bytes of info per pixel, and it gives about five bits to each channel. This means it can only display 32 different red values, 32 different green values, 32 different blue values. Each channel can display only one-eighth of the colors seen on other displays.

When a color is shown on a 16-bit display, most of the time it will have to be rounded to the nearest permitted color. Different renderers in a browser can round colors in different ways. That's why a SWF color and HTML color may have exactly the same definition, but look different from each other on different machines.

Possible solutions:
* Try making designs that don't require absolute color fidelity across all machines.
* Use "herringbone" and other patterns to help hide edges.
* Consider putting more of the page's content inside the SWF.
* On Windows versions of Internet Explorer, you can set the "wmode" attribute to hide an unused SWF background.

For more info.....
http://www.macromedia.com/support/dreamweaver/ts/documents/html_color_shift.htm

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top