-
Refactored rainbow
11/12/2017 at 00:48 • 0 commentsLooks exactly the same. Code different.
At the top:
#define rainbow_numberofcolors 7 const unsigned short rainbowcols[rainbow_numberofcolors] = { rgbto16(255,0,0), rgbto16(255,165,0), rgbto16(255,255,0), rgbto16(0,128,0), rgbto16(0,0,255), rgbto16(75,0,130), rgbto16(238,130,238) };
In the start:
unsigned int barheight = dispheight/rainbow_numberofcolors; for( i = 0; i < rainbow_numberofcolors-1; i = i + 1 ){ plotblock(0, i*barheight, dispwidth, barheight, rainbowcols[i]); }
-
Rainbows as requested.
11/11/2017 at 23:39 • 0 commentsAdded a version to make rainbow stripes, hard coded the longway.
https://github.com/carlynorama/2017superconbadge/blob/master/rainbowbadge.c
right now, super lazy hardcoded way.
plotblock(0, 0, dispwidth, 20, rgbto16(255,0,0)); plotblock(0, 20, dispwidth, 20, rgbto16(255,165,0)); plotblock(0, 40, dispwidth, 20, rgbto16(255,255,0)); plotblock(0, 60, dispwidth, 20, rgbto16(0,128,0)); plotblock(0, 80, dispwidth, 20, rgbto16(0,0,255)); plotblock(0, 100, dispwidth, 20, rgbto16(75,0,130)); plotblock(0, 120, dispwidth, 20, rgbto16(238,130,238));