RealDocs

UKismetMathLibrary::LinearColor_SetFromHSV

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

Description

Converts an HSV color specified by hue (degrees), saturation, and value into linear-space RGB and writes the result into the target FLinearColor. Particularly useful for procedural color generation where animating hue is more intuitive than animating R/G/B.

Caveats & Gotchas

  • H wraps at 360 — passing 360.0 is equivalent to 0.0 (red), but values above 360 are not automatically clamped; test your inputs if they can go out of range.
  • The result is stored as linear RGB internally. If you later read back the R/G/B channels to display or use as sRGB, they will appear brighter than expected without a gamma conversion.

Signature

static UE_INL_API void LinearColor_SetFromHSV(UPARAM(ref) FLinearColor& InOutColor, float H, float S, float V, float A = 1.0f)

Parameters

Name Type Description Default
InOutColor FLinearColor& The color variable to overwrite in-place.
H float Hue in degrees [0.0, 360.0).
S float Saturation in [0.0, 1.0].
V float Value (brightness) in [0.0, 1.0].
A float Alpha in [0.0, 1.0]. 1.0f

Return Type

void

Example

Cycle through the color wheel over time C++
FLinearColor DynamicColor;
float Hue = FMath::Fmod(GetWorld()->GetTimeSeconds() * 60.0f, 360.0f);
UKismetMathLibrary::LinearColor_SetFromHSV(DynamicColor, Hue, 1.0f, 1.0f);
MeshComponent->SetVectorParameterValueOnMaterials(TEXT("Color"), FVector(DynamicColor));

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.