Navigation
API > API/Runtime > API/Runtime/Core
A linear, 32-bit/component floating point RGBA color.
| Name | FLinearColor |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Math/Color.h |
| Include Path | #include "Math/Color.h" |
Syntax
struct FLinearColor
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLinearColor
(
const FVector4d& Vector |
Math/Color.h | ||
FLinearColor
(
const FFloat16Color& C |
Use Float16Color::GetFloats() directly | Math/Color.h | |
constexpr FLinearColor
(
float InR, |
Math/Color.h | ||
FLinearColor
(
const FVector3f& Vector |
Math/Color.h | ||
constexpr FLinearColor
(
const FColor& Color |
Converts an FColor which is assumed to be in sRGB space, into linear color space. | Math/Color.h | |
| Math/Color.h | |||
FLinearColor () |
Math/Color.h | ||
FLinearColor
(
const FVector3d& Vector |
Math/Color.h | ||
FLinearColor
(
const FVector4f& Vector |
Math/Color.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Black | const FLinearColor | Math/Color.h | |
| Blue | const FLinearColor | Math/Color.h | |
| Gray | const FLinearColor | Math/Color.h | |
| Green | const FLinearColor | Math/Color.h | |
| Pow22OneOver255Table | float | Static lookup table used for FColor -> FLinearColor conversion. | Math/Color.h |
| Red | const FLinearColor | Math/Color.h | |
| sRGBToLinearTable | float | Static lookup table used for FColor -> FLinearColor conversion. | Math/Color.h |
| Transparent | const FLinearColor | Math/Color.h | |
| White | const FLinearColor | Common colors. | Math/Color.h |
| Yellow | const FLinearColor | Math/Color.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| A | float | Math/Color.h | ||
| B | float | Math/Color.h | ||
| FLinearColor | union FLinearColor | Math/Color.h | ||
| G | float | Math/Color.h | ||
| R | float | Math/Color.h | ||
| RGBA | float | Math/Color.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const float & Component
(
int32 Index |
Math/Color.h | ||
float & Component
(
int32 Index |
Math/Color.h | ||
FLinearColor CopyWithNewOpacity
(
float NewOpacity |
Math/Color.h | ||
FLinearColor Desaturate
(
float Desaturation |
Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation | Math/Color.h | |
bool Equals
(
const FLinearColor& ColorB, |
Error-tolerant comparison. | Math/Color.h | |
FLinearColor GetClamped
(
float InMin, |
Clamped in 0..1 range | Math/Color.h | |
float GetLuminance() |
Computes the perceptually weighted luminance value of a color. | Math/Color.h | |
float GetMax() |
Returns the maximum value in this color structure | Math/Color.h | |
float GetMin() |
Returns the minimum value in this color structure | Math/Color.h | |
FLinearColor HSVToLinearRGB() |
Converts an HSV color to a linear space RGB color | Math/Color.h | |
bool InitFromString
(
const FString& InSourceString |
Initialize this Color based on an FString. | Math/Color.h | |
bool IsAlmostBlack() |
Useful to detect if a light contribution needs to be rendered | Math/Color.h | |
FLinearColor LinearRGBToHSV() |
Converts a linear space RGB color to an HSV color | Math/Color.h | |
| Quantizes the linear color and returns the result as a FColor. | Math/Color.h | ||
| Quantizes the linear color with rounding and returns the result as a FColor. | Math/Color.h | ||
| Math/Color.h | |||
bool Serialize
(
FStructuredArchive::FSlot Slot |
Math/Color.h | ||
FColor ToFColor
(
const bool bSRGB |
Math/Color.h | ||
| Quantizes the linear color and returns the result as a FColor with optional sRGB conversion. | Math/Color.h | ||
| Conversions. | Math/Color.h | ||
FString ToString() |
Math/Color.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static float Clamp01NansTo0
(
float InValue |
Helper for pixel format conversions. | Math/Color.h | |
static float Dist
(
const FLinearColor& V1, |
Euclidean distance between two points. | Math/Color.h | |
static float EvaluateBezier
(
const FLinearColor* ControlPoints, |
Generates a list of sample points on a Bezier curve defined by 2 points. | Math/Color.h | |
static FLinearColor FromPow22Color
(
const FColor& Color |
Converts an FColor coming from an observed Pow(1/2.2) output, into a linear color. | Math/Color.h | |
static FLinearColor FromSRGBColor
(
const FColor& Color |
Converts an FColor coming from an observed sRGB output, into a linear color. | Math/Color.h | |
static FLinearColor IntToDistinctColor
(
const int32 Seed, |
Helper function to generate distinct colors from a sequence of integers where each integer increment spins around the Hue wheel by increments of the golden ratio. | Math/Color.h | |
static FLinearColor LerpUsingHSV
(
const FLinearColor& From, |
Linearly interpolates between two colors by the specified progress amount. | Math/Color.h | |
static FLinearColor MakeFromColorTemperature
(
float Temp |
Converts temperature in Kelvins of a black body radiator to RGB chromaticity. | Math/Color.h | |
static FLinearColor MakeFromHSV8
(
uint8 H, |
Converts byte hue-saturation-brightness to floating point red-green-blue. | Math/Color.h | |
static FLinearColor MakeRandomColor() |
Makes a random but quite nice color. | Math/Color.h | |
static FLinearColor MakeRandomSeededColor
(
int32 Seed |
Makes a random color based on a seed. | Math/Color.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLinearColor operator-
(
const FLinearColor& ColorB |
Math/Color.h | ||
bool operator!=
(
const FLinearColor& Other |
Math/Color.h | ||
FLinearColor operator*
(
float Scalar |
Math/Color.h | ||
FLinearColor operator*
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor & operator*=
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor & operator*=
(
float Scalar |
Math/Color.h | ||
FLinearColor operator/
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor operator/
(
float Scalar |
Math/Color.h | ||
FLinearColor & operator/=
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor & operator/=
(
float Scalar |
Math/Color.h | ||
FLinearColor operator+
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor & operator+=
(
const FLinearColor& ColorB |
Math/Color.h | ||
FLinearColor & operator-=
(
const FLinearColor& ColorB |
Math/Color.h | ||
bool operator==
(
const FLinearColor& ColorB |
Comparison operators | Math/Color.h |