Merge pull request #12965 from NissimHadar/bug12979

Fix for bug #12979: Setting colors [0, 0, 254] from js api ends up as black color
This commit is contained in:
John Conklin II 2018-04-23 13:49:41 -07:00 committed by GitHub
commit 5a3f44fa15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,7 @@ inline float ColorUtils::tosRGBFloat(const float &linear) {
} else if (0 < linear && linear < SRGB_ELBOW_INV) {
sRGBValue = 12.92f * linear;
} else if (SRGB_ELBOW_INV <= linear && linear < 1) {
sRGBValue = 1.055f * powf(linear, 0.41666f - 0.055f);
sRGBValue = 1.055f * powf(linear, 0.41666f) - 0.055f;
} else {
sRGBValue = 1.0f;
}