Always include the full text of error messages (copy - paste) with the code so we can get any details which may be necessary.

Variables must be declared before they are used. You declared red blue...