Fix gamma correction in HSBType (#996)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2019-08-28 22:24:16 +02:00 committed by Kai Kreuzer
parent 982e938a9e
commit 7d4b21f4d9

View File

@ -335,7 +335,7 @@ public class HSBType extends PercentType implements ComplexType, State, Command
c = 1.0f;
}
return c <= 0.0031308f ? 19.92f * c : (1.0f + 0.055f) * (float) Math.pow(c, 1.0f / 2.4f) - 0.055f;
return c <= 0.0031308f ? 12.92f * c : (1.0f + 0.055f) * (float) Math.pow(c, 1.0f / 2.4f) - 0.055f;
}
// Gamma decompression (sRGB) for a single component, in the 0.0 - 1.0 range
@ -346,7 +346,7 @@ public class HSBType extends PercentType implements ComplexType, State, Command
c = 1.0f;
}
return c <= 0.04045f ? c / 19.92f : (float) Math.pow((c + 0.055f) / (1.0f + 0.055f), 2.4f);
return c <= 0.04045f ? c / 12.92f : (float) Math.pow((c + 0.055f) / (1.0f + 0.055f), 2.4f);
}
/**