refactor to use RGB struct