Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FColor Struct Reference

#include <Color.h>

+ Collaboration diagram for FColor:

Public Member Functions

uint32DWColor (void)
 
const uint32DWColor (void) const
 
FORCEINLINE FColor ()
 
FORCEINLINE FColor (EForceInit)
 
constexpr FORCEINLINE FColor (uint8 InR, uint8 InG, uint8 InB, uint8 InA=255)
 
FORCEINLINE FColor (uint32 InColor)
 
bool Serialize (FArchive &Ar)
 
bool Serialize (FStructuredArchive::FSlot Slot)
 
FORCEINLINE bool operator== (const FColor &C) const
 
FORCEINLINE bool operator!= (const FColor &C) const
 
FORCEINLINE void operator+= (const FColor &C)
 
FLinearColor FromRGBE () const
 
FColor WithAlpha (uint8 Alpha) const
 
FORCEINLINE FLinearColor ReinterpretAsLinear () const
 
FORCEINLINE FString ToHex () const
 
FORCEINLINE FString ToString () const
 
bool InitFromString (const FString &InSourceString)
 
FORCEINLINE uint32 ToPackedARGB () const
 
FORCEINLINE uint32 ToPackedABGR () const
 
FORCEINLINE uint32 ToPackedRGBA () const
 
FORCEINLINE uint32 ToPackedBGRA () const
 

Static Public Member Functions

static FColor FromHex (const FString &HexString)
 
static FColor MakeRandomColor ()
 
static FColor MakeRedToGreenColorFromScalar (float Scalar)
 
static FColor MakeFromColorTemperature (float Temp)
 
static FColor MakeRandomSeededColor (int32 Seed)
 
static uint8 QuantizeUNormFloatTo8 (float UnitFloat)
 
static uint16 QuantizeUNormFloatTo16 (float UnitFloat)
 
static float DequantizeUNorm8ToFloat (int Value8)
 
static float DequantizeUNorm16ToFloat (int Value16)
 
static uint8 Requantize10to8 (int Value10)
 
static uint8 Requantize16to8 (int Value16)
 
static FColor MakeRequantizeFrom1010102 (int R, int G, int B, int A)
 

Public Attributes

union { 
 
   struct { 
 
      uint8   A 
 
      uint8   R 
 
      uint8   G 
 
      uint8   B 
 
   }  
 
   uint32   Bits 
 
};  
 

Static Public Attributes

static ARK_API const FColor White
 
static ARK_API const FColor Black
 
static ARK_API const FColor Transparent
 
static ARK_API const FColor Red
 
static ARK_API const FColor Green
 
static ARK_API const FColor Blue
 
static ARK_API const FColor Yellow
 
static ARK_API const FColor Cyan
 
static ARK_API const FColor Magenta
 
static ARK_API const FColor Orange
 
static ARK_API const FColor Purple
 
static ARK_API const FColor Turquoise
 
static ARK_API const FColor Silver
 
static ARK_API const FColor Emerald
 

Private Member Functions

ARK_API FColor (const FLinearColor &LinearColor)
 

Friends

FArchiveoperator<< (FArchive &Ar, FColor &Color)
 
void operator<< (FStructuredArchive::FSlot Slot, FColor &Color)
 
FORCEINLINE uint32 GetTypeHash (const FColor &Color)
 

Detailed Description

Definition at line 546 of file Color.h.

Constructor & Destructor Documentation

◆ FColor() [1/5]

FORCEINLINE FColor::FColor ( )
inline

Definition at line 560 of file Color.h.

◆ FColor() [2/5]

FORCEINLINE FColor::FColor ( EForceInit )
inlineexplicit

Definition at line 561 of file Color.h.

◆ FColor() [3/5]

constexpr FORCEINLINE FColor::FColor ( uint8 InR,
uint8 InG,
uint8 InB,
uint8 InA = 255 )
inlineconstexpr

Definition at line 566 of file Color.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FColor() [4/5]

FORCEINLINE FColor::FColor ( uint32 InColor)
inlineexplicit

Definition at line 575 of file Color.h.

+ Here is the call graph for this function:

◆ FColor() [5/5]

ARK_API FColor::FColor ( const FLinearColor & LinearColor)
explicitprivate

Please use .ToFColor(true) on FLinearColor if you wish to convert from FLinearColor to FColor, with proper sRGB conversion applied.

Note: Do not implement or make public. We don't want people needlessly and implicitly converting between FLinearColor and FColor. It's not a free conversion.

Member Function Documentation

◆ DequantizeUNorm16ToFloat()

static float FColor::DequantizeUNorm16ToFloat ( int Value16)
inlinestatic

Definition at line 680 of file Color.h.

◆ DequantizeUNorm8ToFloat()

static float FColor::DequantizeUNorm8ToFloat ( int Value8)
inlinestatic

Definition at line 673 of file Color.h.

◆ DWColor() [1/2]

uint32 & FColor::DWColor ( void )
inline

Definition at line 556 of file Color.h.

+ Here is the caller graph for this function:

◆ DWColor() [2/2]

const uint32 & FColor::DWColor ( void ) const
inline

Definition at line 557 of file Color.h.

+ Here is the caller graph for this function:

◆ FromHex()

static FColor FColor::FromHex ( const FString & HexString)
static

Creates a color value from the given hexadecimal string.

Supported formats are: RGB, RRGGBB, RRGGBBAA, #RGB, #RRGGBB, #RRGGBBAA

Parameters
HexString- The hexadecimal string.
Returns
The corresponding color value.
See also
ToHex

◆ FromRGBE()

FLinearColor FColor::FromRGBE ( ) const

◆ InitFromString()

bool FColor::InitFromString ( const FString & InSourceString)
inline

Initialize this Color based on an FString. The String is expected to contain R=, G=, B=, A=. The FColor will be bogus when InitFromString returns false.

Parameters
InSourceStringFString containing the color values.
Returns
true if the R,G,B values were read successfully; false otherwise.

Definition at line 782 of file Color.h.

+ Here is the call graph for this function:

◆ MakeFromColorTemperature()

static FColor FColor::MakeFromColorTemperature ( float Temp)
static

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

◆ MakeRandomColor()

static FColor FColor::MakeRandomColor ( )
static

Makes a random but quite nice color.

◆ MakeRandomSeededColor()

static FColor FColor::MakeRandomSeededColor ( int32 Seed)
static

Makes a random color based on a seed.

◆ MakeRedToGreenColorFromScalar()

static FColor FColor::MakeRedToGreenColorFromScalar ( float Scalar)
static

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

◆ MakeRequantizeFrom1010102()

static FColor FColor::MakeRequantizeFrom1010102 ( int R,
int G,
int B,
int A )
inlinestatic

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

Definition at line 717 of file Color.h.

+ Here is the call graph for this function:

◆ operator!=()

FORCEINLINE bool FColor::operator!= ( const FColor & C) const
inline

Definition at line 610 of file Color.h.

+ Here is the call graph for this function:

◆ operator+=()

FORCEINLINE void FColor::operator+= ( const FColor & C)
inline

Definition at line 615 of file Color.h.

◆ operator==()

FORCEINLINE bool FColor::operator== ( const FColor & C) const
inline

Definition at line 605 of file Color.h.

+ Here is the call graph for this function:

◆ QuantizeUNormFloatTo16()

static uint16 FColor::QuantizeUNormFloatTo16 ( float UnitFloat)
inlinestatic

Definition at line 667 of file Color.h.

+ Here is the call graph for this function:

◆ QuantizeUNormFloatTo8()

static uint8 FColor::QuantizeUNormFloatTo8 ( float UnitFloat)
inlinestatic

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

Definition at line 661 of file Color.h.

+ Here is the call graph for this function:

◆ ReinterpretAsLinear()

FORCEINLINE FLinearColor FColor::ReinterpretAsLinear ( ) const
inline

Reinterprets the color as a linear color. This is the correct dequantizer for QuantizeRound. This matches the GPU spec conversion for U8<->float

Returns
The linear color representation.

Definition at line 746 of file Color.h.

+ Here is the call graph for this function:

◆ Requantize10to8()

static uint8 FColor::Requantize10to8 ( int Value10)
inlinestatic

Definition at line 687 of file Color.h.

+ Here is the caller graph for this function:

◆ Requantize16to8()

static uint8 FColor::Requantize16to8 ( int Value16)
inlinestatic

Definition at line 701 of file Color.h.

◆ Serialize() [1/2]

bool FColor::Serialize ( FArchive & Ar)
inline

Definition at line 586 of file Color.h.

◆ Serialize() [2/2]

bool FColor::Serialize ( FStructuredArchive::FSlot Slot)
inline

Definition at line 598 of file Color.h.

◆ ToHex()

FORCEINLINE FString FColor::ToHex ( ) const
inline

Converts this color value to a hexadecimal string.

The format of the string is RRGGBBAA.

Returns
Hexadecimal string.
See also
FromHex, ToString

Definition at line 759 of file Color.h.

◆ ToPackedABGR()

FORCEINLINE uint32 FColor::ToPackedABGR ( ) const
inline

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

Definition at line 807 of file Color.h.

◆ ToPackedARGB()

FORCEINLINE uint32 FColor::ToPackedARGB ( ) const
inline

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

Definition at line 799 of file Color.h.

◆ ToPackedBGRA()

FORCEINLINE uint32 FColor::ToPackedBGRA ( ) const
inline

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

Definition at line 823 of file Color.h.

◆ ToPackedRGBA()

FORCEINLINE uint32 FColor::ToPackedRGBA ( ) const
inline

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

Definition at line 815 of file Color.h.

◆ ToString()

FORCEINLINE FString FColor::ToString ( ) const
inline

Converts this color value to a string.

Returns
The string representation.
See also
ToHex

Definition at line 770 of file Color.h.

◆ WithAlpha()

FColor FColor::WithAlpha ( uint8 Alpha) const
inline
Returns
a new FColor based of this color with the new alpha value. Usage: const FColor& MyColor = FColorList::Green.WithAlpha(128);

Definition at line 735 of file Color.h.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ GetTypeHash

FORCEINLINE uint32 GetTypeHash ( const FColor & Color)
friend

Definition at line 844 of file Color.h.

◆ operator<< [1/2]

FArchive & operator<< ( FArchive & Ar,
FColor & Color )
friend

Definition at line 581 of file Color.h.

◆ operator<< [2/2]

void operator<< ( FStructuredArchive::FSlot Slot,
FColor & Color )
friend

Definition at line 593 of file Color.h.

Member Data Documentation

◆ [union]

union { ... } FColor

◆ A

uint8 FColor::A

Definition at line 553 of file Color.h.

◆ B

uint8 FColor::B

Definition at line 553 of file Color.h.

◆ Bits

uint32 FColor::Bits

Definition at line 553 of file Color.h.

◆ Black

ARK_API const FColor FColor::Black
static

Definition at line 830 of file Color.h.

◆ Blue

ARK_API const FColor FColor::Blue
static

Definition at line 834 of file Color.h.

◆ Cyan

ARK_API const FColor FColor::Cyan
static

Definition at line 836 of file Color.h.

◆ Emerald

ARK_API const FColor FColor::Emerald
static

Definition at line 842 of file Color.h.

◆ G

uint8 FColor::G

Definition at line 553 of file Color.h.

◆ Green

ARK_API const FColor FColor::Green
static

Definition at line 833 of file Color.h.

◆ Magenta

ARK_API const FColor FColor::Magenta
static

Definition at line 837 of file Color.h.

◆ Orange

ARK_API const FColor FColor::Orange
static

Definition at line 838 of file Color.h.

◆ Purple

ARK_API const FColor FColor::Purple
static

Definition at line 839 of file Color.h.

◆ R

uint8 FColor::R

Definition at line 553 of file Color.h.

◆ Red

ARK_API const FColor FColor::Red
static

Definition at line 832 of file Color.h.

◆ Silver

ARK_API const FColor FColor::Silver
static

Definition at line 841 of file Color.h.

◆ Transparent

ARK_API const FColor FColor::Transparent
static

Definition at line 831 of file Color.h.

◆ Turquoise

ARK_API const FColor FColor::Turquoise
static

Definition at line 840 of file Color.h.

◆ White

ARK_API const FColor FColor::White
static

Some pre-inited colors, useful for debug code

Definition at line 829 of file Color.h.

◆ Yellow

ARK_API const FColor FColor::Yellow
static

Definition at line 835 of file Color.h.


The documentation for this struct was generated from the following file: