UKismetMathLibrary::RGBLinearToHSV
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts a linear RGB FLinearColor to a packed HSV FLinearColor by value (H in R, S in G, V in B). The return-by-value form of RGBToHSV_Vector; use this when the result is immediately consumed rather than stored.
Caveats & Gotchas
- • The R channel of the returned FLinearColor contains Hue in degrees [0, 360) — it is NOT a valid linear red channel. Never use the return value as a color directly; treat it as a named tuple of H, S, V.
- • Round-tripping through RGBLinearToHSV → HSVToRGBLinear is not lossless for achromatic (grey) colors: hue information is discarded (set to 0) and cannot be recovered.
Signature
static UE_INL_API FLinearColor RGBLinearToHSV(FLinearColor RGB) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RGB | FLinearColor | The linear RGB color to convert. | — |
Return Type
FLinearColor Example
Extract hue from a linear color by value C++
FLinearColor MyColor = FLinearColor(0.0f, 0.8f, 0.2f, 1.0f);
FLinearColor HSVResult = UKismetMathLibrary::RGBLinearToHSV(MyColor);
float Hue = HSVResult.R; // degrees See Also
Version History
Introduced in: 4.18
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?