Lerp Color between 4 corners

Given 4 color values at each corner of a quad. how would i lerp between them so that i start with the right color and end with the right color at each corner?

this is known as Bilinear Interpolation, and 3D hardware does it literally all the time.

if you want to do it yourself, it might look something like this:
(not tested)

assuming a coordinate system something like this,
with a different color at each corner,
what's the color at u, v ?


  0, 1                     1, 1
    *-----------------------*
    |                       |
    |                       |
    |             *         |
    |             u, v      |
    |                       |
    |                       |
    |                       |
    |                       |
    *-----------------------*
  0, 0                     1, 0



Color bilinear(Color[,] corners, Vector2 uv) {
	Color cTop = Color.lerp(corners[0, 1], corners[1, 1], uv.x);
	Color cBot = Color.lerp(corners[0, 0], corners[1, 0], uv.x);
	Color cUV  = Color.lerp(cBot, cTop, uv.y);
	return cUV;
}