Computer Science Canada whatdotcolor is terrible. Here's a better one. |
Author: | ttm [ Sun Nov 27, 2011 9:14 pm ] | ||
Post subject: | whatdotcolor is terrible. Here's a better one. | ||
Turing's built in whatdotcolor function is terrible. It gives the approximate color of a pixel instead of the exact red, green, and blue values. That means you can't apply special effects to photos. Bleh. Therefore I rewrote a new whatdotcolor function. It works by taking a picture of the screen using the takepic function, which returns an integer array containing the raw picture information, and then directly fetching the red, green, and blue values from the array. Its syntax is the exact same as the original whatdotcolor, but instead of a color number, it returns a pixel class with R, G, and B values. Here's a demo: http://dl.dropbox.com/u/17181264/better%20what%20dot%20color.zip. It first screenloads a picture, and then repeatedly inverts the picture over and over, using up a LOT of memory in the process. Here it is:
and here is the demo in action: |
Author: | SNIPERDUDE [ Sun Nov 27, 2011 11:19 pm ] |
Post subject: | RE:whatdotcolor is terrible. Here\'s a better one. |
Useful. |
Author: | [Gandalf] [ Mon Nov 28, 2011 1:43 am ] |
Post subject: | RE:whatdotcolor is terrible. Here\'s a better one. |
whatdotcolor is terrible? 7 years ago you would be slaughtered by a certain moderator for such sacrilege! But times have changed - good work, you seem to have a good grasp of the language. My main critisism would be that your variable naming needs work... bleh (and n) are horrible variable names, use something more descriptive! |
Author: | dannyboy8899 [ Mon Feb 20, 2012 4:07 am ] |
Post subject: | RE:whatdotcolor is terrible. Here\'s a better one. |
THE CAKE IS A LIE! |