UKismetMathLibrary::Multiply_LinearColorFloat
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Scales all four channels of a linear color by a single float. The canonical way to control emissive intensity or dim/brighten a color uniformly.
Caveats & Gotchas
- • All four channels including alpha are scaled — multiplying by 0.5 halves both the color intensity and the opacity, which is usually undesirable for UI colors. Build a separate alpha if you need independent control.
- • Negative multipliers are not clamped and will produce negative channel values, which can cause visual artifacts in standard rendering pipelines.
Signature
static UE_INL_API FLinearColor Multiply_LinearColorFloat(FLinearColor A, float B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FLinearColor | Color to scale. | — |
| B | float | Scalar multiplier applied to all four channels. | — |
Return Type
FLinearColor Example
Scale emissive intensity from a gameplay parameter C++
FLinearColor BaseEmissive = FLinearColor(1.f, 0.8f, 0.2f, 0.f);
float Intensity = 3.f; // HDR brightness
FLinearColor Emissive = UKismetMathLibrary::Multiply_LinearColorFloat(BaseEmissive, Intensity);
DynamicMaterial->SetVectorParameterValue(TEXT("Emissive"), Emissive); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?