Language:
Discover
By Skill Level
By Category

FLinearColor

Choose your OS:

Syntax

struct FLinearColor

Remarks

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

A linear color. The full C++ class is located here: Engine\Source\Runtime\Core\Public\Math\Color.h

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
)

FColor->FLinearColor conversion.

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 float ...

 

Component

(
    int32 Index
)

Public function

float &

 

Component

(
    int32 Index
)

Operators.

Public function

float

 

ComputeLuminance()

Computes the perceptually weighted luminance value of a color.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

CopyWithNewOpacity

(
    float NewOpacicty
)

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

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

bool

 

Equals

(
    const FLinearColor & ColorB,
    float Tolerance
)

Error-tolerant comparison.

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1) flo...

 

EvaluateBezier

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

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

Path length.

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

FGetHSV

(
    uint8 H,
    uint8 S,
    uint8 V
)

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

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

FromPow22Color

(
    const FColor & Color
)

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

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

FromSRGBColor

(
    const FColor & Color
)

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

Public function

FLinearColor

 

GetClamped

(
    float InMin,
    float InMax
)

Clamped in 0..1 range

Public function

float

 

GetLuminance()

Public function

float

 

GetMax()

Returns the maximum value in this color structure

The maximum color channel value

Public function

float

 

GetMin()

Returns the minimum value in this color structure

The minimum color channel value

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

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

bool

 

IsAlmostBlack()

Useful to detect if a light contribution needs to be rendered

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

LerpUsingHSV

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

Linearly interpolates between two colors by the specified progress amount.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

LinearRGBToHSV()

Converts a linear space RGB color to an HSV color

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

MakeFromColorTemperature

(
    float Temp
)

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

Public function Static

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FLin ...

 

MakeRandomColor()

Makes a random but quite nice color.

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FCol ...

 

Quantize()

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

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FCol ...

 

QuantizeRound()

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

Public function

bool

 

Serialize

(
    FArchive & Ar
)

Public function

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FCol ...

 

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

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FCol ...

 

ToRGBE()

Conversions.

Public function

FString

 

ToString()

Operators

Name Description

Public function

FLinearColor

 

operator-

(
    const FLinearColor & ColorB
)

Public function

bool

 

operator!=

(
    const FLinearColor & Other
)

Public function

FLinearColor

 

operator*

(
    const FLinearColor & ColorB
)

Public function

FLinearColor

 

operator*

(
    float Scalar
)

Public function

FLinearColor ...

 

operator*=

(
    const FLinearColor & ColorB
)

Public function

FLinearColor ...

 

operator*=

(
    float Scalar
)

Public function

FLinearColor

 

operator/

(
    const FLinearColor & ColorB
)

Public function

FLinearColor

 

operator/

(
    float Scalar
)

Public function

FLinearColor ...

 

operator/=

(
    float Scalar
)

Public function

FLinearColor ...

 

operator/=

(
    const FLinearColor & ColorB
)

Public function

FLinearColor

 

operator+

(
    const FLinearColor & ColorB
)

Public function

FLinearColor ...

 

operator+=

(
    const FLinearColor & ColorB
)

Public function

FLinearColor ...

 

operator-=

(
    const FLinearColor & ColorB
)

Public function

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

References

Module

Core

Header

Runtime/Core/Public/Math/Color.h