Improve color code parsing