Re: Font color

From: Date: Sat, 16 Apr 2005 03:48:32 +0000
Subject: Re: Font color
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-213172@lists.php.net to get a copy of this message
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

« previous php.general (#213172) next »