I have a set of images that are loaded randomly during a program. From these images I'm creating a palette of colour taken from the current image loaded. The code works except that I'm only creating a palette of colour from the first image loaded at the beginning of the program. I want to be able to create a new palette from each new image loaded during the running of the program - so resetting the value of the return function in somecolour() each time a new image is loaded. Any hints at where I'm going wrong will be much appreciated. Thanks.
to your restart method should do the trick if i've understood what you're asking for correctly, also i really don't understand what your program is suppose to do (besides giving people a headache with flashing colors :p) would you mind explaining the purpose of this program? :)
edit: ok just to clarify do you want to keep the old palette? because doing what i said will replace the old palette with a new one