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