UKismetMathLibrary::Conv_DoubleToLinearColor
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts a double scalar into a FLinearColor by assigning the same value to R, G, and B channels with alpha fixed at 1.0. Primarily used as an implicit Blueprint autocast node when a float is wired to a LinearColor pin.
Caveats & Gotchas
- • All three RGB channels are set to the same value, producing a grey of that brightness. This is rarely intentional outside of debug/greyscale uses — if you need a specific color, use MakeLinearColor or LinearColor_SetRGBA instead.
- • The function takes a double but FLinearColor channels are stored as float. If InDouble carries more precision than float can represent, it is silently truncated on assignment.
Signature
static UE_INL_API FLinearColor Conv_DoubleToLinearColor(double InDouble) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InDouble | double | The scalar value to broadcast into all three RGB channels. Alpha is set to 1.0. | — |
Return Type
FLinearColor Example
Create a mid-grey LinearColor from a float scalar C++
double Brightness = 0.5;
FLinearColor Grey = UKismetMathLibrary::Conv_DoubleToLinearColor(Brightness);
// Grey == FLinearColor(0.5f, 0.5f, 0.5f, 1.0f) Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?