Page 2 of 2

Posted: Sun Feb 06, 2005 1:00 pm
by feyd
psst, Code Snippets ;) :lol:

Posted: Sun Feb 06, 2005 6:45 pm
by Chris Corbyn
BTW... if you want the highlighted version that's easier to read click here... http://www.chriscorbyn.co.uk/colors/source.php - It'll be nice when we get our PHP tags back. I really should get to bed now or I'm gonna be driving to work late at 100mph :wink:

Posted: Mon Feb 07, 2005 4:31 pm
by Chris Corbyn
I changed

Code: Select all

r_hex -= inc_x_r //followed by (at the top of the loop)
if (r_hex < 0) &#123;
    r_hex = 0
&#125;
To just say

Code: Select all

r_hex = Math.max(0, (r_hex - inc_x_r))
Not sure if it's actually faster or not.... I think I'm just shaving milliseconds of now so it's hard to tell. Logically it would be faster because you overwrite the variable less often right? and it's not going through condition checks

Posted: Mon Feb 07, 2005 6:29 pm
by Chris Corbyn
Ok I think I've done enough on this now... It's never gonna be instant with so much to process but it only take millisecs now which is BIG improvement on the start of this post for anybody who happened to check it.

I'm not adding anything fancier... it works well so let's leave it at that.

Code posted in snippet here.... viewtopic.php?p=156829#156829 as promised so you can do as you please with it but please update the post if you do make any changes because I'll be interested to see them.

Actual PHP source http://www.chriscorbyn.co.uk/colors/source.php

Thanks for all your help on this!!!