Color class extension
#1
Apost 
The Color class should provide the following method:

UInt32 ToUInt32Clamped() const
{
UInt32 red = Math::Clamp<SInt32>(Math::Round(mColor[RED] * Float(255.0)), 0, 255);
UInt32 green = Math::Clamp<SInt32>(Math::Round(mColor[GREEN] * Float(255.0)), 0, 255);
UInt32 blue = Math::Clamp<SInt32>(Math::Round(mColor[BLUE] * Float(255.0)), 0, 255);
UInt32 alpha = Math::Clamp<SInt32>(Math::Round(mColor[ALPHA] * Float(255.0)), 0, 255);
return red + (green << 8) + (blue << 16) + (alpha << 24);
}

This will help converting overdriven floating point color values.
Reply
#2
Apost 
Hi Andy,

thanks for your proposal. We will consider it for the next update.
Reply


Forum Jump:


Copyright © 2011-2017 Spraylight GmbH.