FSlateColor

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

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Styling/SlateColor.h

Include

#include "Styling/SlateColor.h"

Syntax

struct FSlateColor

Remarks

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

Variables

Name Description

Protected variable

TEnumAsByte < ES ...

 

ColorUseRule

The rule for which color to pick.

Protected variable

FLinearColor

 

SpecifiedColor

The current specified color; only meaningful when ColorToUse == UseColor_Specified.

Constructors

Name Description

Public function

FSlateColor()

Default constructor.

Uninitialized Slate colors are Fuchsia by default.

Public function

FSlateColor

(
    const FLinearColor & InColor
)

Creates a new Slate color with the specified values.

Public function

FSlateColor

(
    const TSharedRef < FLinearColor >& ...
)

Creates a new Slate color that is linked to the given values.

Protected function

FSlateColor

(
    ESlateColorStylingMode::Type InColo...
)

Private constructor to prevent construction of invalid FSlateColors.

Destructors

Name Description

Public function

~FSlateColor()

Functions

Name Description

Public function Const

const FLinea ...

 

GetColor

(
    const FWidgetStyle & InWidgetStyle
)

Gets the color value represented by this Slate color.

Public function Const

FLinearColor

 

GetSpecifiedColor()

Gets the specified color value.

Public function Const

bool

 

IsColorSpecified()

Checks whether the values for this color have been specified.

Public function

bool

 

SerializeFromMismatchedTag

(
    const FPropertyTag & Tag,
    FStructuredArchive::FSlot Slot
)

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

Public function

void

 

Unlink()

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.

Public function Static

FSlateColor

 

UseForeground()

Public function Static

FSlateColor

 

UseSubduedForeground()

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FSlateColor & Other
)

Compares this color with another for inequality.

Public function Const

bool

 

operator==

(
    const FSlateColor & Other
)

Compares this color with another for equality.

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