Language:
Discover
By Skill Level
By Category

FColor

Choose your OS:

Syntax

struct FColor

Remarks

FColor Stores a color with 8 bits of precision per channel. Note: Linear color values should always be converted to gamma space before stored in an FColor , as 8 bits of precision is not enough to store linear space colors! This can be done with FLinearColor::ToFColor(true)

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

Variables

Name Description

Public variable

union FColor::@...

 

@141

Variables.

Public variable

uint8

 

A

Public variable

uint32

 

AlignmentDummy

Public variable

uint8

 

B

Public variable

uint8

 

G

Public variable

uint8

 

R

Constructors

Name Description

Public function

FColor()

Constructors.

Public function

FColor

(
    EForceInit
)

Public function

FColor

(
    uint32 InColor
)

Public function

FColor

(
    uint8 InR,
    uint8 InG,
    uint8 InB,
    uint8 InA
)

Functions

Name Description

Public function

const uint32 ...

 

DWColor()

Public function

uint32 &

 

DWColor()

Public function Static

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

 

FromHex

(
    const FString & HexString
)

Creates a color value from the given hexadecimal string.

Public function

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

 

FromRGBE()

Convert from RGBE to float as outlined in Gregory Ward's Real Pixels article, Graphics Gems II, page 80.

Public function

bool

 

InitFromString

(
    const FString & InSourceString
)

Initialize this Color based on an FString .

Public function Static

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

 

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)FCol ...

 

MakeRandomColor()

Makes a random but quite nice color.

Public function Static

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

 

MakeRedToGreenColorFromScalar

(
    float Scalar
)

Makes a color red->green with the passed in scalar (e.g. 0 is red, 1 is green)

Public function

FLinearColor

 

ReinterpretAsLinear()

Reinterprets the color as a linear color.

The linear color representation.

Public function

bool

 

Serialize

(
    FArchive & Ar
)

Public function

FString

 

ToHex()

Converts this color value to a hexadecimal string.

Public function

uint32

 

ToPackedABGR()

Gets the color in a packed uint32 format packed in the order ABGR.

Public function

uint32

 

ToPackedARGB()

Gets the color in a packed uint32 format packed in the order ARGB.

Public function

uint32

 

ToPackedBGRA()

Gets the color in a packed uint32 format packed in the order BGRA.

Public function

uint32

 

ToPackedRGBA()

Gets the color in a packed uint32 format packed in the order RGBA.

Public function

FString

 

ToString()

Converts this color value to a string.

The string representation.

Public function

FColor

 

WithAlpha

(
    uint8 Alpha
)

A new FColor based of this color with the new alpha value.

Operators

Name Description

Public function

bool

 

operator!=

(
    const FColor & C
)

Public function

void

 

operator+=

(
    const FColor & C
)

Public function

bool

 

operator==

(
    const FColor & C
)

Operators.

Constants

Name

Description

Black

Blue

Cyan

Emerald

Green

Magenta

Orange

Purple

Red

Silver

Transparent

Turquoise

White

Some pre-inited colors, useful for debug code

Yellow

References

Module

Core

Header

Runtime/Core/Public/Math/Color.h