Finally cracked this and boy was it satisfying to figure out the last rule (yellow). Hint #5 was really the key for me. 10/10