Is there a function $f$ such that
$$f(x,y,n)=f(x+y,y-x,n+1)$$ $$f(x,y,n)\neq f(x+1,y,n)$$ $$f(x,y,n)\neq f(x,y+1,n)$$
where $x,y$ are integers, $n$ is a positive integer and the range of $f$ is a finite set? If so, what is the least number of values $f$ can attain?
EDIT: deleted
EDIT: To make the below pattern nicer here is my final suggestion for an additional condition to make this problem non trivial:
For each $x,y,n$ there should exist an $a>0,b>0$ such that for all $k,l$
$$f(x,y,n)=f(x+ak,y+bl,n)$$
(all numbers are integer, n is positive). This basically states that equal colors should have at least one regular vector grid displacement.
My goal is to reduce the number of colors!
EDIT: Sorry, for the confusion. Here is my explanation what's going on and a last attempt to adjust the conditions.

These are three consecutive steps in the animation. In the second picture the square move as to make space for new light blue squares. In the third picture the light blue squares have reached their full size and the process starts again. This is a problem I got with coloring a checker board. If anyone would like to translate a Processing Python to Java and post it on Openprocessing, I'd be happy.
SOLUTION:
Thanks to Michael the animated pattern now works and looks like:
