FColor

[FColor](API\Runtime\Core\Math\FColor) Stores a color with 8 bits of precision per channel.

References

Module

Core

Header

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

Include

#include "Math/Color.h"

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)

Variables

Name Description

Public variable

union FColor::@...

 

@379

Variables.

Public variable

uint8

 

A

Public variable

uint8

 

B

Public variable

uint32

 

Bits

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
)

Put these into the body for proper ordering with INTEL vs non-INTEL_BYTE_ORDER

Functions

Name Description

Public function Static

float

 

DequantizeUNorm16ToFloat

(
    int Value16
)

Public function Static

float

 

DequantizeUNorm8ToFloat

(
    int Value8
)

Public function Const

const uint32...

 

DWColor()

Public function

uint32 &

 

DWColor()

Public function Static

FColor

 

FromHex

(
    const FString& HexString
)

Creates a color value from the given hexadecimal string.

Public function Const

FLinearColor

 

FromRGBE()

Converts from RGBE to a linear float color 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

FColor

 

MakeFromColorTemperature

(
    float Temp
)

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

Public function Static

FColor

 

MakeRandomColor()

Makes a random but quite nice color.

Public function Static

FColor

 

MakeRandomSeededColor

(
    int32 Seed
)

Makes a random color based on a seed.

Public function Static

FColor

 

MakeRedToGreenColorFromScalar

(
    float Scalar
)

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

Public function Static

FColor

 

MakeRequantizeFrom1010102

(
    int R,
    int G,
    int B,
    int A
)

Return 8-bit color Quantized from 10-bit RGB , 2-bit A

Public function Static

uint16

 

QuantizeUNormFloatTo16

(
    float UnitFloat
)

Public function Static

uint8

 

QuantizeUNormFloatTo8

(
    float UnitFloat
)

Conversions to/from GPU UNorm floats, U8, U16 matches convention of FColorFLinearColor::QuantizeRound

Public function Const

FLinearColor

 

ReinterpretAsLinear()

Reinterprets the color as a linear color.

Public function Static

uint8

 

Requantize10to8

(
    int Value10
)

Public function Static

uint8

 

Requantize16to8

(
    int Value16
)

Public function

bool

 

Serialize

(
    FArchive& Ar
)

Public function

bool

 

Serialize

(
    FStructuredArchive::FSlot Slot
)

Public function Const

FString

 

ToHex()

Converts this color value to a hexadecimal string.

The format of the string is RRGGBBAA.

Public function Const

uint32

 

ToPackedABGR()

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

Public function Const

uint32

 

ToPackedARGB()

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

Public function Const

uint32

 

ToPackedBGRA()

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

Public function Const

uint32

 

ToPackedRGBA()

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

Public function Const

FString

 

ToString()

Converts this color value to a string.

Public function Const

FColor

 

WithAlpha

(
    uint8 Alpha
)

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FColor& C
)

Public function

void

 

operator+=

(
    const FColor& C
)

Public function Const

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

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