FColor

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

Windows
MacOS
Linux

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::@...

 

@151

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
)

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

Functions

Name Description

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()

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

 

MakeRedToGreenColorFromScalar

(
    float Scalar
)

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

Public function Const

FLinearColor

 

ReinterpretAsLinear()

Reinterprets the color as a linear color.

Public function

bool

 

Serialize

(
    FStructuredArchive::FSlot Slot
)

Public function

bool

 

Serialize

(
    FArchive& Ar
)

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

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback