For rectangles you could use your ellipse calculations.
Because the bounding rectangle of such an ellipse exactly defines the rectangle and its color you are looking for :)
rectangles are just a simplified version of the ellipse, because the only values you calculate are the ones directly on the x and y axis.
Because the bounding rectangle of such an ellipse exactly defines the rectangle and its color you are looking for :)
rectangles are just a simplified version of the ellipse, because the only values you calculate are the ones directly on the x and y axis.