[FINITO] Can this be speeded up? Plz help (Nice Hex Color Pa
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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 
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I changed
To just say
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
Code: Select all
r_hex -= inc_x_r //followed by (at the top of the loop)
if (r_hex < 0) {
r_hex = 0
}Code: Select all
r_hex = Math.max(0, (r_hex - inc_x_r))- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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!!!
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!!!