/* Cycles all LEDs at once through a rainbow.  */
static int ws2812_effects_mode_rainbow()
/* Cycles all LEDs at once through a rainbow.  */
static int ws2812_effects_mode_rainbow()
{
    *p++ = g * state->brightness / BRIGHTNESS_MAX;
    *p++ = r * state->brightness / BRIGHTNESS_MAX;
    *p++ = b * state->brightness / BRIGHTNESS_MAX;
    for (j = 3; j < pixbuf_channels(buffer); j++)
    {
      *p++ = 0;
    }
  }
  state->counter_mode_step = (state->counter_mode_step + 1) % 360;
  return 0;
}