mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
ColorI::fromLinear fix
This commit is contained in:
parent
d939a4440d
commit
3cb5f6ca21
1 changed files with 4 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue