 }
 
 // Returns the color from the palette. Return black if pixelindex is -1.
+// Multiply the resulting color with the brightnessFactor. This was not needed
+// after all.
 uint32_t lookupColor(int pixelIndex, float brightnessFactor) {
   if (pixelIndex < 0 || pixelIndex >= IMAGE_SIZE) {
     rgb = {0, 0, 0};


// Lookup the pixel's color for the wheel based interface.
uint32_t wheelColorLookup(int led, float angle) {
  float maxAngle = IMAGE_WIDTH / float(IMAGE_HEIGHT) * 100 / 34;
  int x = int(mapfloat(angle, -PI, maxAngle, 0.0, float(IMAGE_WIDTH-1)));

  if (x >= IMAGE_WIDTH) {
    return lookupColor(-1, 1.0);
  }


  /* Accelerometer code */
  /**********************/

  // The ifndef is needed because pulseIn expects PWM signal, without the
  // accelerometer connected the loop function got called very slowly.
  #ifndef TIMER
  int pulseX = pulseIn(ACCEL_X_PIN, HIGH);
  int pulseY = pulseIn(ACCEL_Y_PIN, HIGH);
