/* Fall 2022 Lab 9  fillFlagArray.c

 	fills array with pixel colors
 	inputs:  the flag array that was declared in main(), width & height
 	outputs:  none
*/

#include <stdio.h>
#include "defs.h"



void fillFlagArray(pixel_t aFlag[], int width, int height) {
	int i, j, k = 0;;
	pixel_t aPixel;

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



