UKismetMathLibrary::MakeColor
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Constructs an FLinearColor from individual R, G, B, and optional A components. The Blueprint NativeMakeFunc for FLinearColor — this is the node that appears when you 'Make LinearColor' in the Blueprint graph.
Caveats & Gotchas
- • Components are in linear space, not sRGB. If you are matching a hex color from a design tool (which is typically sRGB), you must gamma-correct each channel with FMath::Pow(Channel / 255.f, 2.2f) before passing it here.
- • Values above 1.0 are valid for HDR emissive materials; they are not clamped.
Signature
static UE_INL_API FLinearColor MakeColor(float R, float G, float B, float A = 1.0f); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| R | float | Red channel value (linear, typically 0-1). | — |
| G | float | Green channel value (linear, typically 0-1). | — |
| B | float | Blue channel value (linear, typically 0-1). | — |
| A | float | Alpha channel value (0 = fully transparent, 1 = fully opaque). | 1.0f |
Return Type
FLinearColor Example
Create a semi-transparent orange color C++
FLinearColor Orange = UKismetMathLibrary::MakeColor(1.f, 0.5f, 0.f, 0.75f);
DynamicMaterial->SetVectorParameterValue(TEXT("HighlightColor"), Orange); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?