Added a hash table (or whatever js equivalent is) to the getColor function to speed up the filters.