mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Fix gamma correction in HSBType (#996)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
982e938a9e
commit
7d4b21f4d9
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user