Hello,
I am looking for a simpler way to divide an array into 12 equal parts... (or somewhat equal)
i did this:
CRGB temp[patternLength];
if (justonce == 0) {
justonce = 1;
fill_gradient(temp, 0, CHSV(20, 255, 240) , patternLength / 6, CHSV(20, 255, 240));
fill_gradient(temp, patternLength / 6, CHSV(20, 255, 240) , ((patternLength / 6) + (patternLength / 12)), CHSV(20, 80, 200));
fill_gradient(temp, ((patternLength / 6) + (patternLength / 12)), CHSV(20, 80, 200) , patternLength / 3, CHSV(160, 255, 255));
fill_gradient(temp, (patternLength / 3), CHSV(160, 255, 255) , (2 * patternLength / 3), CHSV(160, 255, 255));
fill_gradient(temp, (2 * patternLength / 3), CHSV(160, 255, 255) , ((2 * patternLength / 3) + (patternLength / 12)), CHSV(160, 80, 200));
fill_gradient(temp, ((2 * patternLength / 3) + (patternLength / 12)), CHSV(160, 80, 200) , (5 * patternLength / 6), CHSV(20, 255, 240));
fill_gradient(temp, (5 * patternLength / 6), CHSV(20, 255, 240) , patternLength, CHSV(20, 255, 240));
}
but, its very sloppy.. and it doesn't seem to work well.
basically, it divides the array into 12ths, and fills in a color... is there an easier way to do this? I thought of the modulus operator, but i'm not sure how it would work here.