public static void Draw_HISTOGRAM_POLY_FILL(float _x, float _y, float _w, float _h, Color _col_MIN, Color _col_MAX, params float[] _values) { int _TOTAL_BINS = _values.Length; int _TOTAL_VERTS = (_TOTAL_BINS * 2); float _DIV = _w / (_TOTAL_BINS - 1); GL_DRAW.Vert[] _VERTS = new GL_DRAW.Vert[_TOTAL_VERTS + 1]; for (int i = 0; i < _TOTAL_BINS; i++) { float _CURRENT = _x + (_DIV * i); // TOP VERT float _BIN_VALUE = _values[i]; Color _COL = Color.Lerp(_col_MIN, _col_MAX, _BIN_VALUE); _VERTS[i] = new GL_DRAW.Vert(_CURRENT, _y + (_h * _BIN_VALUE), _COL); // BTM VERT _VERTS[_TOTAL_VERTS - i] = new GL_DRAW.Vert(_CURRENT, _y, _col_MIN); } // now draw the poly for (int i = 0; i < _TOTAL_BINS - 1; i++) { GL_DRAW.Draw_QUAD(_VERTS[i], _VERTS[i + 1], _VERTS[_TOTAL_VERTS - (i + 1)], _VERTS[_TOTAL_VERTS - i]); } }