-
-
Notifications
You must be signed in to change notification settings - Fork 264
NeoGamma object
The NeoGamma object provides an easy way to convert a color object to a gamma corrected value. The human eye perceives light levels differently than what the NeoPixels show. NeoPixels brightness levels are very linear so this object will convert them to the nonlinear so that what you see is what you expected.
To construct one, you need provide a gamma model that defines how it does the calculation. There are several models already supplied to select from.
NeoGamma<NeoGammaTableMethod> colorGamma;
Once you have one, you can then just call the Correct() method on it to get a gamma corrected color.
color = colorGamma.Correct(color);
This will return the 8-bit RGB color corrected into the human perceived linear visible spectrum.
This will return the 8-bit RGBW color corrected into the human perceived linear visible spectrum.
This will return the 16-bit RGB color corrected into the human perceived linear visible spectrum.
This will return the 16-bit RGBW color corrected into the human perceived linear visible spectrum.