add inverse gamma 32 function and fix colors in pride (#4722)

* add inverse gamma 32 function and fix for colors in pride
This commit is contained in:
Damian Schneider
2025-06-11 08:30:25 +02:00
committed by GitHub
parent 00d1fcc5fb
commit 05f0630b9c
4 changed files with 19 additions and 2 deletions

View File

@@ -598,3 +598,17 @@ uint32_t IRAM_ATTR_YN NeoGammaWLEDMethod::Correct32(uint32_t color)
b = gammaT[b];
return RGBW32(r, g, b, w);
}
uint32_t IRAM_ATTR_YN NeoGammaWLEDMethod::inverseGamma32(uint32_t color)
{
if (!gammaCorrectCol) return color;
uint8_t w = W(color);
uint8_t r = R(color);
uint8_t g = G(color);
uint8_t b = B(color);
w = gammaT_inv[w];
r = gammaT_inv[r];
g = gammaT_inv[g];
b = gammaT_inv[b];
return RGBW32(r, g, b, w);
}