UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateColor Struct Reference

#include <SlateColor.h>

Public Member Functions

 FSlateColor ()
 
 FSlateColor (const FLinearColor &InColor)
 
 FSlateColor (const FColor InColor)
 
 FSlateColor (const TSharedRef< FLinearColor > &InColor)
 
 FSlateColor (EStyleColor InColorTableId)
 
const FLinearColorGetColor (const FWidgetStyle &InWidgetStyle) const
 
FLinearColor GetSpecifiedColor () const
 
bool IsColorSpecified () const
 
void Unlink ()
 
bool operator== (const FSlateColor &Other) const
 
bool operator!= (const FSlateColor &Other) const
 
SLATECORE_API bool SerializeFromMismatchedTag (const struct FPropertyTag &Tag, FStructuredArchive::FSlot Slot)
 

Static Public Member Functions

static FSlateColor UseForeground ()
 
static FSlateColor UseSubduedForeground ()
 
static FSlateColor UseStyle ()
 

Protected Member Functions

 FSlateColor (ESlateColorStylingMode InColorUseRule)
 
SLATECORE_API const FLinearColorGetColorFromTable () const
 

Protected Attributes

FLinearColor SpecifiedColor
 
ESlateColorStylingMode ColorUseRule
 

Detailed Description

A Slate color can be a directly specified value, or the color can be pulled from a WidgetStyle.

Examples
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

Constructor & Destructor Documentation

◆ FSlateColor() [1/6]

FSlateColor::FSlateColor ( )
inline

Default constructor.

Uninitialized Slate colors are Fuchsia by default.

◆ FSlateColor() [2/6]

FSlateColor::FSlateColor ( const FLinearColor InColor)
inline

Creates a new Slate color with the specified values.

Parameters
InColorThe color value to assign.

◆ FSlateColor() [3/6]

FSlateColor::FSlateColor ( const FColor  InColor)
inline

Creates a new Slate color with the specified values.

Parameters
InColorThe color value to assign.

◆ FSlateColor() [4/6]

FSlateColor::FSlateColor ( const TSharedRef< FLinearColor > &  InColor)
inline

◆ FSlateColor() [5/6]

FSlateColor::FSlateColor ( EStyleColor  InColorTableId)
inline

◆ FSlateColor() [6/6]

FSlateColor::FSlateColor ( ESlateColorStylingMode  InColorUseRule)
inlineprotected

Member Function Documentation

◆ GetColor()

const FLinearColor & FSlateColor::GetColor ( const FWidgetStyle InWidgetStyle) const
inline

Gets the color value represented by this Slate color.

Parameters
InWidgetStyleThe widget style to use when this color represents a foreground or subdued color.
Returns
The color value.
See also
GetSpecifiedColor

◆ GetColorFromTable()

const FLinearColor & FSlateColor::GetColorFromTable ( ) const
protected

◆ GetSpecifiedColor()

FLinearColor FSlateColor::GetSpecifiedColor ( ) const
inline

Gets the specified color value.

Returns
The specified color value.
See also
GetColor, IsColorSpecified

◆ IsColorSpecified()

bool FSlateColor::IsColorSpecified ( ) const
inline

Checks whether the values for this color have been specified.

Returns
true if specified, false otherwise.
See also
GetSpecifiedColor

◆ operator!=()

bool FSlateColor::operator!= ( const FSlateColor Other) const
inline

Compares this color with another for inequality.

Parameters
OtherThe other color.
Returns
false if the two colors are equal, true otherwise.

◆ operator==()

bool FSlateColor::operator== ( const FSlateColor Other) const
inline

Compares this color with another for equality.

Parameters
OtherThe other color.
Returns
true if the two colors are equal, false otherwise.

◆ SerializeFromMismatchedTag()

bool FSlateColor::SerializeFromMismatchedTag ( const struct FPropertyTag Tag,
FStructuredArchive::FSlot  Slot 
)

Used to upgrade an FColor or FLinearColor property to an FSlateColor property

◆ Unlink()

void FSlateColor::Unlink ( )
inline

If the color rule is set to UseColor_Specified_Link, this will copy the linked color internally, unlink it and set the color rule to UseColor_Specified. Nothing happens if the color rule is not set to UseColor_Specified_Link.

◆ UseForeground()

static FSlateColor FSlateColor::UseForeground ( )
inlinestatic
Returns
an FSlateColor that is the widget's foreground.

◆ UseStyle()

static FSlateColor FSlateColor::UseStyle ( )
inlinestatic
Returns
an FSlateColor that is the subdued version of the widget's foreground.

◆ UseSubduedForeground()

static FSlateColor FSlateColor::UseSubduedForeground ( )
inlinestatic
Returns
an FSlateColor that is the subdued version of the widget's foreground.

Member Data Documentation

◆ ColorUseRule

ESlateColorStylingMode FSlateColor::ColorUseRule
protected

◆ SpecifiedColor

FLinearColor FSlateColor::SpecifiedColor
protected

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