From 1f477914aafbb58ddfb416bbc2f07b32422c63ed Mon Sep 17 00:00:00 2001 From: rextimmy Date: Sun, 13 Aug 2017 19:39:44 +1000 Subject: [PATCH] ColorI::fromLinear fix --- Engine/source/core/color.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/core/color.h b/Engine/source/core/color.h index 075662599..afc62353e 100644 --- a/Engine/source/core/color.h +++ b/Engine/source/core/color.h @@ -884,10 +884,10 @@ inline ColorI LinearColorF::toColorI(const bool keepAsLinear) inline ColorI ColorI::fromLinear() { //manually create LinearColorF, otherwise it will try and convert to linear first - LinearColorF linearColor = LinearColorF(F32(red) * 255.0f + 0.5f, - F32(red) * 255.0f + 0.5f, - F32(red) * 255.0f + 0.5f, - F32(alpha) * 255.0f + 0.5f); + LinearColorF linearColor = LinearColorF(F32(red) * gOneOver255, + F32(green) * gOneOver255, + F32(blue) * gOneOver255, + F32(alpha) * gOneOver255); //convert back to srgb return linearColor.toColorI(); }