Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| function getAverageColourAsRGB (img) { | |
| var canvas = document.createElement('canvas'), | |
| context = canvas.getContext && canvas.getContext('2d'), | |
| rgb = {r:102,g:102,b:102}, // Set a base colour as a fallback for non-compliant browsers | |
| pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel | |
| count = 0, | |
| i = -4, | |
| data, length; | |
| // return the base colour for non-compliant browsers |