// http://colorbrewer2.org/ function ColorMap() { // public this.byConference = function(conference) // no restrictions { if (bigFive.indexOf(conference) >= 0) { return colors[0]; } if (groupOfFive.indexOf(conference) >= 0) { return colors[1]; } return colors[2]; }; this.getConferenceColors = function() { return [ { category: 'Big Five', color: colors[0] }, { category: 'Group Of Five', color: colors[1] }, { category: 'Independent', color: colors[2] } ]; }; // private variables var bigFive = [ 'SEC', 'ACC', 'Big 12', 'Pac-12', 'Big Ten' ]; var groupOfFive = [ 'American', 'Sun Belt', 'MWC', 'MAC', 'CUSA' ]; var colors = [ '#e41a1c', '#377eb8', '#4daf4a' ]; }