FLinearColor

A linear, 32-bit/component floating point RGBA color.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/Color.h

Include

#include "Math/Color.h"

Syntax

struct FLinearColor

Remarks

A linear, 32-bit/component floating point RGBA color.

Variables

Name Description

Public variable

float

 

A

Public variable

float

 

B

Public variable

float

 

G

Public variable

float

 

R

Constructors

Name Description

Public function

FLinearColor()

Public function

FLinearColor

(
    EForceInit
)

Public function

FLinearColor

(
    const FColor& Color
)

Converts an FColor which is assumed to be in sRGB space, into linear color space.

Public function

FLinearColor

(
    const FVector& Vector
)

Public function

FLinearColor

(
    const FVector4& Vector
)

Public function

FLinearColor

(
    const FFloat16Color& C
)

Public function

FLinearColor

(
    float InR,
    float InG,
    float InB,
    float InA
)

Functions

Name Description

Public function Const

const float ...

 

Component

(
    int32 Index
)

Public function

float &

 

Component

(
    int32 Index
)

Public function Const

float

 

ComputeLuminance()

Computes the perceptually weighted luminance value of a color.

Public function Const

FLinearColor

 

CopyWithNewOpacity

(
    float NewOpacicty
)

Public function Const

FLinearColor

 

Desaturate

(
    float Desaturation
)

Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation

Public function Static

float

 

Dist

(
    const FLinearColor& V1,
    const FLinearColor& V2
)

Euclidean distance between two points.

Public function Const

bool

 

Equals

(
    const FLinearColor& ColorB,
    float Tolerance
)

Error-tolerant comparison.

Public function Static

float

 

EvaluateBezier

(
    const FLinearColor* ControlPoi...,
    int32 NumPoints,
    TArray< FLinearColor >& OutPoints
)

Generates a list of sample points on a Bezier curve defined by 2 points.

Public function Static

FLinearColor

 

FromPow22Color

(
    const FColor& Color
)

Converts an FColor coming from an observed Pow(1/2.2) output, into a linear color.

Public function Static

FLinearColor

 

FromSRGBColor

(
    const FColor& Color
)

Converts an FColor coming from an observed sRGB output, into a linear color.

Public function Const

FLinearColor

 

GetClamped

(
    float InMin,
    float InMax
)

Clamped in 0..1 range

Public function Const

float

 

GetLuminance()

Public function Const

float

 

GetMax()

Returns the maximum value in this color structure

Public function Const

float

 

GetMin()

Returns the minimum value in this color structure

Public function Const

FLinearColor

 

HSVToLinearRGB()

Converts an HSV color to a linear space RGB color

Public function

bool

 

InitFromString

(
    const FString& InSourceString
)

Initialize this Color based on an FString.

Public function Const

bool

 

IsAlmostBlack()

Useful to detect if a light contribution needs to be rendered

Public function Static

FLinearColor

 

LerpUsingHSV

(
    const FLinearColor& From,
    const FLinearColor& To,
    const float Progress
)

Linearly interpolates between two colors by the specified progress amount.

Public function Const

FLinearColor

 

LinearRGBToHSV()

Converts a linear space RGB color to an HSV color

Public function Static

FLinearColor

 

MakeFromColorTemperature

(
    float Temp
)

Converts temperature in Kelvins of a black body radiator to RGB chromaticity.

Public function Static

FLinearColor

 

MakeFromHSV8

(
    uint8 H,
    uint8 S,
    uint8 V
)

Converts byte hue-saturation-brightness to floating point red-green-blue.

Public function Static

FLinearColor

 

MakeRandomColor()

Makes a random but quite nice color.

Public function Const

FColor

 

Quantize()

Quantizes the linear color and returns the result as a FColor.

Public function Const

FColor

 

QuantizeRound()

Quantizes the linear color with rounding and returns the result as a FColor.

Public function

bool

 

Serialize

(
    FStructuredArchive::FSlot Slot
)

Public function Const

FColor

 

ToFColor

(
    const bool bSRGB
)

Quantizes the linear color and returns the result as a FColor with optional sRGB conversion and quality as goal.

Public function Const

FColor

 

ToRGBE()

Conversions.

Public function Const

FString

 

ToString()

Operators

Name Description

Public function Const

FLinearColor

 

operator-

(
    const FLinearColor& ColorB
)

Public function Const

bool

 

operator!=

(
    const FLinearColor& Other
)

Public function Const

FLinearColor

 

operator*

(
    const FLinearColor& ColorB
)

Public function Const

FLinearColor

 

operator*

(
    float Scalar
)

Public function

FLinearColor...

 

operator*=

(
    float Scalar
)

Public function

FLinearColor...

 

operator*=

(
    const FLinearColor& ColorB
)

Public function Const

FLinearColor

 

operator/

(
    const FLinearColor& ColorB
)

Public function Const

FLinearColor

 

operator/

(
    float Scalar
)

Public function

FLinearColor...

 

operator/=

(
    float Scalar
)

Public function

FLinearColor...

 

operator/=

(
    const FLinearColor& ColorB
)

Public function Const

FLinearColor

 

operator+

(
    const FLinearColor& ColorB
)

Public function

FLinearColor...

 

operator+=

(
    const FLinearColor& ColorB
)

Public function

FLinearColor...

 

operator-=

(
    const FLinearColor& ColorB
)

Public function Const

bool

 

operator==

(
    const FLinearColor& ColorB
)

Comparison operators

Constants

Name

Description

Black

Blue

Gray

Green

Pow22OneOver255Table

Static lookup table used for FColor -> FLinearColor conversion.

Red

sRGBToLinearTable

Static lookup table used for FColor -> FLinearColor conversion.

Transparent

White

Common colors.

Yellow

Deprecated Functions

Name Description

Public function Static

FLinearColor

 

FGetHSV

(
    uint8 H,
    uint8 S,
    uint8 V
)

FGetHSV doesn't perform a valid HSV conversion, use MakeFromHSV8 instead

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss