whitespace, OCD
[SugarCubes.git] / _Internals.pde
index 580e1730433f070baf019a40e421d19997ac34fc..a358f1b3202a94fd15c104314d51500a0ddcce80 100644 (file)
@@ -204,6 +204,17 @@ void draw() {
     debugUI.draw();
   }
   
+  // Gamma correction here. Apply a cubic to the brightness
+  // for better representation of dynamic range
+  for (int i = 0; i < colors.length; ++i) {
+    float b = brightness(colors[i]) / 100.f;
+    colors[i] = color(
+      hue(colors[i]),
+      saturation(colors[i]),
+      (b*b*b) * 100.
+    );
+  }
+  
   // TODO(mcslee): move into GLucose engine
   for (PandaDriver p : pandaBoards) {
     p.send(colors);