/*Steven Spivack
 * CpSc 1011 Section 5
 * Oct 27, 2022
 * Lab 9A
 * This file assigns rgb colors into an array name "flag"
 * for later use in mainDriver
*/
#include "defs.h"

void fillFlagArray(pixel flag[], int width, int height){
	int i, j, k = 0;
	pixel color;

	for (i = 0; i < height; i++) {
		for ( j = 0; j < width / 3; j ++) {
			color.r = 0;
			color.g = 128;
			color.b = 0;
			flag[k] = color;
			++k;
		}
		for (; j < width * 2/3; j++) {
			color.r = 255;
			color.g = 255;
			color.b = 255;
			flag[k] = color;
			++k;
		}
		for (; j < width; j++) {
			color.r = 255;
			color.g = 165;
			color.b = 0;
			flag[k] = color;
			++k;
		}
	}
}
