UKismetMathLibrary::Subtract_LinearColorLinearColor
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Subtracts color B from color A channel-by-channel (A.R-B.R, A.G-B.G, A.B-B.B, A.A-B.A). The Blueprint - operator for LinearColor.
Caveats & Gotchas
- • Channels are not clamped — if B's channel exceeds A's, the result is negative, which is physically meaningless for color but valid in HDR math pipelines.
- • Subtracting colors is rarely the right tool for blending; for most visual effects, lerp or multiply produce more predictable results.
Signature
static UE_INL_API FLinearColor Subtract_LinearColorLinearColor(FLinearColor A, FLinearColor B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FLinearColor | Color to subtract from. | — |
| B | FLinearColor | Color to subtract. | — |
Return Type
FLinearColor Example
Remove a tint from a composite color C++
FLinearColor Composite = FLinearColor(0.8f, 0.5f, 0.3f, 1.f);
FLinearColor Tint = FLinearColor(0.2f, 0.1f, 0.0f, 0.f);
FLinearColor Base = UKismetMathLibrary::Subtract_LinearColorLinearColor(Composite, Tint);
// Base = (0.6, 0.4, 0.3, 1.0) Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?