You find the complementary color by subtracting each color band from 255 (assuming 8-bit color). The problem with this is that if your original color is medium gray, the complementary color will be very close to it and you will get no legibility. So you have to test for this case and go to some other color, perhaps black or white.
<br><br>Amos<br><br><div><span class="gmail_quote">On 4/26/07, <b class="gmail_sendername"><a href="mailto:export@hope.cz">export@hope.cz</a></b> &lt;<a href="mailto:export@hope.cz">export@hope.cz</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 Christopher ,<br> Thank you for your reply.<br><br> Is there a way how to find out a complementary colour for an area where I will write the text, so<br> that the text will be seen clearly?Is there a routine in PIL or in Python somewhere?
<br> Thank you for help<br> Lad.<br></blockquote></div><br>