Can jquery fill a polygon with a color?

Can jquery fill a polygon with a color?

I have some code (below) that builds a polygon shape (using an array). It's a simple 5 sided polygon.

I'd like to fill it with a color. Does jQuery have a way to fill a polygon with color?

Thank you...

  1. function buildPolygonEnvelope() {
    	var cgEnvelope = document.getElementById("idEnvelope").value;
    	polygon = [];
    	var str1 = cgEnvelope.split("@");
    	for (i = 0; i < str1.length; i++) {
    		var str = str1[i].split(',').map(parseFloat);
    		polygon.push( [ str[0] , str[1] ] );
    		polygon.push( [ str[2] , str[3] ] );
    	}
    	str = str1[0].split(',').map(parseFloat);
    	polygon.push( [ str[0] , str[1] ] );
    }