UKismetMathLibrary::Divide_LinearColorLinearColor
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Divides color A by color B 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
- • No divide-by-zero protection — if any channel of B is 0, that result channel will be infinity (or NaN), which can corrupt materials or trigger assertions. Always guard B's channels.
- • Division is uncommon in typical color workflows; consider whether you actually want Multiply_LinearColorFloat with the reciprocal, which is more predictable.
Signature
static UE_INL_API FLinearColor Divide_LinearColorLinearColor(FLinearColor A, FLinearColor B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FLinearColor | Dividend color. | — |
| B | FLinearColor | Divisor color. | — |
Return Type
FLinearColor Example
Normalize a color by a reference white point C++
FLinearColor Measured = FLinearColor(0.4f, 0.8f, 0.6f, 1.f);
FLinearColor WhitePoint = FLinearColor(0.5f, 0.9f, 0.8f, 1.f);
FLinearColor Normalized = UKismetMathLibrary::Divide_LinearColorLinearColor(Measured, WhitePoint);
// Ensure no channel of WhitePoint is 0 before calling See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?