Skip to content
Michael Miller edited this page Apr 2, 2023 · 2 revisions

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);

NeoGamma

Methods

RgbColor Correct(const RgbColor& original)

This will return the 8-bit RGB color corrected into the human perceived linear visible spectrum.

RgbwColor Correct(const RgbwColor& original)

This will return the 8-bit RGBW color corrected into the human perceived linear visible spectrum.

Rgb48Color Correct(const Rgb48Color& original)

This will return the 16-bit RGB color corrected into the human perceived linear visible spectrum.

Rgbw64Color Correct(const Rgbw64Color& original)

This will return the 16-bit RGBW color corrected into the human perceived linear visible spectrum.

Clone this wiki locally