UKismetMathLibrary::LinearColor_Quantize
Deprecated: Use LinearColor_QuantizeRound instead for correct color conversion.
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Quantizes a FLinearColor to an 8-bit FColor by truncating each channel (floor), bypassing sRGB gamma conversion. Deprecated — use LinearColor_QuantizeRound for correct color rounding.
Caveats & Gotchas
- • This function is deprecated. The Blueprint node shows a deprecation warning. Use LinearColor_QuantizeRound instead, which rounds rather than truncates, producing more accurate 8-bit representations.
- • Because it bypasses sRGB gamma, the result looks darker than expected when displayed on a typical monitor. Only use this if your target explicitly expects raw linear-to-byte truncation (which is rare).
Signature
static UE_INL_API FColor LinearColor_Quantize(FLinearColor InColor) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InColor | FLinearColor | The linear color to quantize to 8-bit values. | — |
Return Type
FColor Example
Legacy quantization (prefer LinearColor_QuantizeRound instead) C++
// DEPRECATED — prefer LinearColor_QuantizeRound
FLinearColor Lin(0.5f, 0.5f, 0.5f, 1.0f);
FColor Legacy = UKismetMathLibrary::LinearColor_Quantize(Lin);
// Legacy.R == 127 (floor of 0.5*255), not perceptually mid-grey Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Use LinearColor_QuantizeRound instead for correct color conversion. |
Feedback
Was this helpful?