Reply to Re: [PHP] Font color

Your name:

Reply:


Posted by trlists on 04/16/05 06:48

On 16 Apr 2005 Ryan A wrote:

> eg: if they pick white I need the heading to be black and vice
> versa...any way to do this?

Well it depends what you mean by "opposite", but as a starting approach
I would try simply complementing the bits in the RGB value:

$opposite_color = $original_color ^ 0xFFFFFF;

This will yield, for example, all of the following, and their
inverses:

#000000 => #FFFFFF (black => white)
#FF0000 => #00FFFF (red => cyan)
#00FF00 => #FF00FF (green => magenta)
#0000FF => #FFFF00 (blue => yellow)

--
Tom

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация