UKismetMathLibrary::Conv_LinearColorToVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts a FLinearColor to a FVector by mapping R→X, G→Y, B→Z and discarding the alpha channel. This autocast is used when wiring a LinearColor to a Vector pin in Blueprint, such as when setting a material vector parameter.
Caveats & Gotchas
- • Alpha is silently dropped. If you need to preserve opacity information, extract it before conversion.
- • The resulting FVector is in the same numeric range as the LinearColor channels — typically [0, 1] for standard colors, but potentially > 1 for HDR. Passing it to functions that expect world-space coordinates (e.g., offsets, normals) can produce silently wrong results.
Signature
static UE_INL_API FVector Conv_LinearColorToVector(FLinearColor InLinearColor) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InLinearColor | FLinearColor | The linear color to convert; only R, G, B are used — alpha is discarded. | — |
Return Type
FVector Example
Pass a LinearColor to a material vector parameter C++
FLinearColor TeamColor = FLinearColor(0.1f, 0.4f, 0.9f, 1.0f);
FVector ColorVec = UKismetMathLibrary::Conv_LinearColorToVector(TeamColor);
MeshComponent->SetVectorParameterValueOnMaterials(TEXT("TeamColor"), ColorVec); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?