#include "project_colors.h"

void MakeColors(unsigned int cols[], color c0, color c1, int n0, int n1)
{
	float dr,dg,db,da;
	float cr,cg,cb,ca;

	cr=c0.r; cg=c0.g; cb=c0.b; ca=c0.a;

	dr=((float)c1.r - (float)c0.r)/(float)(n1 - n0 + 1);
	dg=((float)c1.g - (float)c0.g)/(float)(n1 - n0 + 1);
	db=((float)c1.b - (float)c0.b)/(float)(n1 - n0 + 1);
	da=((float)c1.a - (float)c0.a)/(float)(n1 - n0 + 1);

    int i;
	for (i=n0; i<=n1; i++)
	{
		cr+=dr;	cg+=dg;	cb+=db; ca+=da;
		cols[i]= ((int)ca<<24) | ((int)cr<<16) | ((int)cg<<8) | (int)cb;
	}
}
