A structure that represents a color as RGBA components.
More...
|
| constexpr | Color (ColorRaw color={}) noexcept |
| | Wraps Color.
|
| constexpr | Color (Uint8 r, Uint8 g, Uint8 b, Uint8 a=255) noexcept |
| | Constructs from its fields.
|
| constexpr Uint8 | GetR () const noexcept |
| | Get the red component from the color.
|
| constexpr Color & | SetR (Uint8 newR) noexcept |
| | Set the red component from the color.
|
| constexpr Uint8 | GetG () const noexcept |
| | Get the green component from the color.
|
| constexpr Color & | SetG (Uint8 newG) noexcept |
| | Set the green component from the color.
|
| constexpr Uint8 | GetB () const noexcept |
| | Get the blue component from the color.
|
| constexpr Color & | SetB (Uint8 newB) noexcept |
| | Set the blue component from the color.
|
| constexpr Uint8 | GetA () const noexcept |
| | Get the alpha component from the color.
|
| constexpr Color & | SetA (Uint8 newA) noexcept |
| | Set the alpha component from the color.
|
| Uint32 | Map (const PixelFormatDetails &format, PaletteConstRef palette) const |
| | Map an RGBA quadruple to a pixel value for a given pixel format.
|
A structure that represents a color as RGBA components.
The bits of this structure can be directly reinterpreted as an integer-packed color which uses the PIXELFORMAT_RGBA32 format (PIXELFORMAT_ABGR8888 on little-endian systems and PIXELFORMAT_RGBA8888 on big-endian systems).
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Wrap extending struct
- See also
- FColor
◆ Color() [1/2]
| SDL::Color::Color |
( |
ColorRaw | color = {} | ) |
|
|
inlineconstexprnoexcept |
Wraps Color.
- Parameters
-
| color | the value to be wrapped |
◆ Color() [2/2]
Constructs from its fields.
- Parameters
-
| r | the value for channel r. |
| g | the value for channel g. |
| b | the value for channel b. |
| a | the value for channel a. |
◆ GetA()
| Uint8 SDL::Color::GetA |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the alpha component from the color.
- Returns
- The alpha component from the color.
◆ GetB()
| Uint8 SDL::Color::GetB |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the blue component from the color.
- Returns
- The blue component from the color.
◆ GetG()
| Uint8 SDL::Color::GetG |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the green component from the color.
- Returns
- The green component from the color.
◆ GetR()
| Uint8 SDL::Color::GetR |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the red component from the color.
- Returns
- The red component from the color.
◆ SetA()
Set the alpha component from the color.
- Parameters
-
| newA | New alpha component value. |
- Returns
- Reference to self.
◆ SetB()
Set the blue component from the color.
- Parameters
-
| newB | New blue component value. |
- Returns
- Reference to self.
◆ SetG()
Set the green component from the color.
- Parameters
-
| newG | New green component value. |
- Returns
- Reference to self.
◆ SetR()
Set the red component from the color.
- Parameters
-
| newR | New red component value. |
- Returns
- Reference to self.
The documentation for this struct was generated from the following file: