/* 
    Tenchi Applegate
    10/25/2022
    Lab section 2
    CPSC1011
    Lab 9A
    Gathers width input from the user to create a ppm file with structs 
    using rgb values to create the Ireland flag using arrays and imbedded for loops.
    Using source files and a header file to separate code.
*/

#include "defs.h"

void fillFlagArray(pixels_t pixel_array[], int width, int height) {
    int i, j, k = 0;

    for (i = 0; i < height; i++) {
        for (j = 0; j < width/3; j++) {
            pixel_array[k++] = (pixels_t) {0, 128, 0};
        }
        for (; j < width * 2/3; j++) {
            pixel_array[k++] = (pixels_t) {255, 255, 255};
        }
        for (; j < width; j++) {
            pixel_array[k++] = (pixels_t) {255, 165, 0};
        }
    }
}