UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
WidgetStyle.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Math/Color.h"
7
8struct FSlateColor;
9template< typename ObjectType > class TAttribute;
10
15{
16public:
17
20 : ColorAndOpacityTint(FLinearColor::White)
21 , ForegroundColor(FLinearColor::White)
22 , SubduedForeground(FLinearColor::White*SubdueAmount)
23 { }
24
25public:
26
34 {
35 ColorAndOpacityTint *= InTint;
36 return *this;
37 }
38
45 FWidgetStyle& BlendOpacity( float InOpacity )
46 {
47 ColorAndOpacityTint.A *= InOpacity;
48 return *this;
49 }
50
59 {
60 ForegroundColor = InForeground;
61
62 SubduedForeground = InForeground;
63 SubduedForeground.A *= SubdueAmount;
64
65 return *this;
66 }
67
78
79public:
80
88 {
89 return ColorAndOpacityTint;
90 }
91
99 {
100 return ForegroundColor;
101 }
102
110 {
111 return SubduedForeground;
112 }
113
114private:
115
116 FLinearColor ColorAndOpacityTint;
117 FLinearColor ForegroundColor;
118 FLinearColor SubduedForeground;
119
120private:
121
122 static SLATECORE_API const float SubdueAmount;
123};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition WidgetStyle.h:15
FWidgetStyle()
Definition WidgetStyle.h:19
const FLinearColor & GetColorAndOpacityTint() const
Definition WidgetStyle.h:87
FWidgetStyle & BlendOpacity(float InOpacity)
Definition WidgetStyle.h:45
FWidgetStyle & SetForegroundColor(const FLinearColor &InForeground)
Definition WidgetStyle.h:58
const FLinearColor & GetForegroundColor() const
Definition WidgetStyle.h:98
const FLinearColor & GetSubduedForegroundColor() const
Definition WidgetStyle.h:109
FWidgetStyle & BlendColorAndOpacityTint(const FLinearColor &InTint)
Definition WidgetStyle.h:33
Definition Attribute.h:17
Definition Color.h:48
float A
Definition Color.h:56
Definition SlateColor.h:42