RealDocs

UKismetMathLibrary::BreakColor

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Decomposes an FLinearColor into its individual R, G, B, and A float components. The Blueprint NativeBreakFunc for FLinearColor.

Caveats & Gotchas

  • Output values are in linear space; if you need 0-255 sRGB byte values for UI or debugging, convert with InColor.ToFColor(true) and read its R/G/B/A bytes instead.
  • In C++ you can access InColor.R, InColor.G, InColor.B, InColor.A directly without calling this function; this wrapper exists primarily for Blueprint.

Signature

static UE_INL_API void BreakColor(FLinearColor InColor, float& R, float& G, float& B, float& A);

Parameters

Name Type Description Default
InColor FLinearColor The linear color to decompose.
R float& Output red channel (linear space).
G float& Output green channel (linear space).
B float& Output blue channel (linear space).
A float& Output alpha channel.

Return Type

void

Example

Extract alpha from a color to drive UI opacity C++
FLinearColor WidgetColor = Widget->GetColorAndOpacity().GetSpecifiedColor();
float R, G, B, A;
UKismetMathLibrary::BreakColor(WidgetColor, R, G, B, A);
UE_LOG(LogTemp, Log, TEXT("Widget alpha: %f"), A);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.