X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=a358f1b3202a94fd15c104314d51500a0ddcce80;hb=6702151ac6a806d916403b2a60e3dc1e52b712aa;hp=8b2e3da71afa4e408845f78669dace1f2a580e82;hpb=e7f14d4d86fc5f0228895b610971a032fa096394;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index 8b2e3da..a358f1b 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -204,9 +204,16 @@ void draw() { debugUI.draw(); } - // TODO(dan): if you want to, here would be a good place to - // put in gamma correction, modifying the colors that get - // sent to the pandaboards, without mucking up the UI here + // 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) {