examples/js/controllers.js
function getColor(country) {
                if (!country || !country["region-code"]) {
                    return "#FFF";
                }
                var colors = continentProperties[country["region-code"]].colors;
                var index = country["alpha-3"].charCodeAt(0) % colors.length ;
                return colors[index];
            }
function getColor(country) {
                if (!country || !country["region-code"]) {
                    return "#FFF";
                }
                var colors = continentProperties[country["region-code"]].colors;
                var index = country["alpha-3"].charCodeAt(0) % colors.length ;
                return colors[index];
            }
function getColor ( country ) { if ( ! country || ! country [ "region-code" ] ) { return "#FFF" ; } var colors = continentProperties [ country [ "region-code" ] ] . colors ; var index = country [ "alpha-3" ] . charCodeAt ( 0 ) % colors . length ; return colors [ index ] ; }
Get a country paint color from the continents array of colors
Get a country paint color from the continents array of colors