Implement gradient parse routine and fix errors in color parse routine.