MCPcopy Create free account
hub / github.com/CalcProgrammer1/KeyboardVisualizer / DrawRainbow

Function DrawRainbow

KeyboardVisualizerCommon/Visualizer.cpp:768–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768void DrawRainbow(int bright, float bkgd_step, vis_pixels *pixels)
769{
770 bright = (int)(bright * (255.0f / 100.0f));
771 for (int x = 0; x < 256; x++)
772 {
773 for (int y = 0; y < 64; y++)
774 {
775 int hsv_h = ((int)(bkgd_step + (256 - x)) % 360);
776 hsv_t hsv = { 0, 0, 0 };
777 hsv.hue = hsv_h;
778 hsv.saturation = 255;
779 hsv.value = (unsigned char)bright;
780 pixels->pixels[y][x] = hsv2rgb(&hsv);
781 }
782 }
783}
784
785void DrawColorWheel(int bright, float bkgd_step, int center_x, int center_y, vis_pixels *pixels)
786{

Callers 1

DrawPatternMethod · 0.85

Calls 1

hsv2rgbFunction · 0.85

Tested by

no test coverage detected