SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::FColor Struct Reference

The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXELFORMAT_RGBA128_FLOAT format. More...

Inheritance diagram for SDL::FColor:
Inheritance graph
[legend]
Collaboration diagram for SDL::FColor:
Collaboration graph
[legend]

Public Member Functions

constexpr FColor (const FColorRaw &color={}) noexcept
 Wraps FColor. More...
 
constexpr FColor (float r, float g, float b, float a=1) noexcept
 Constructs from its fields. More...
 
constexpr float GetR () const noexcept
 Get the red component from the color. More...
 
constexpr FColorSetR (float newR) noexcept
 Set the red component from the color. More...
 
constexpr float GetG () const noexcept
 Get the green component from the color. More...
 
constexpr FColorSetG (float newG) noexcept
 Set the green component from the color. More...
 
constexpr float GetB () const noexcept
 Get the blue component from the color. More...
 
constexpr FColorSetB (float newB) noexcept
 Set the blue component from the color. More...
 
constexpr float GetA () const noexcept
 Get the alpha component from the color. More...
 
constexpr FColorSetA (float newA) noexcept
 Set the alpha component from the color. More...
 

Detailed Description

Since
This struct is available since SDL 3.2.0.
Category:
Wrap extending struct
See also
Color

Constructor & Destructor Documentation

◆ FColor() [1/2]

constexpr SDL::FColor::FColor ( const FColorRaw color = {})
inlineconstexprnoexcept
Parameters
colorthe value to be wrapped

◆ FColor() [2/2]

constexpr SDL::FColor::FColor ( float  r,
float  g,
float  b,
float  a = 1 
)
inlineconstexprnoexcept
Parameters
rthe value for r.
gthe value for g.
bthe value for b.
athe value for a.

Member Function Documentation

◆ GetA()

constexpr float SDL::FColor::GetA ( ) const
inlineconstexprnoexcept
Returns
The alpha component from the color.

◆ GetB()

constexpr float SDL::FColor::GetB ( ) const
inlineconstexprnoexcept
Returns
The blue component from the color.

◆ GetG()

constexpr float SDL::FColor::GetG ( ) const
inlineconstexprnoexcept
Returns
The green component from the color.

◆ GetR()

constexpr float SDL::FColor::GetR ( ) const
inlineconstexprnoexcept
Returns
The red component from the color.

◆ SetA()

constexpr FColor & SDL::FColor::SetA ( float  newA)
inlineconstexprnoexcept
Parameters
newANew alpha component value.
Returns
Reference to self.

◆ SetB()

constexpr FColor & SDL::FColor::SetB ( float  newB)
inlineconstexprnoexcept
Parameters
newBNew blue component value.
Returns
Reference to self.

◆ SetG()

constexpr FColor & SDL::FColor::SetG ( float  newG)
inlineconstexprnoexcept
Parameters
newGNew green component value.
Returns
Reference to self.

◆ SetR()

constexpr FColor & SDL::FColor::SetR ( float  newR)
inlineconstexprnoexcept
Parameters
newRNew red component value.
Returns
Reference to self.

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