|
ReXGlue SDK
|
#include <rex/ui/style.h>
Public Member Functions | |
| constexpr Color | WithAlpha (f32 alpha) const |
| constexpr Color | Scaled (f32 factor) const |
| constexpr u32 | ToRGBA8 () const |
| constexpr u32 | ToARGB8 () const |
| constexpr bool | operator== (const Color &other) const =default |
Static Public Member Functions | |
| static constexpr Color | FromRGBA (f32 r, f32 g, f32 b, f32 a=1) |
| static constexpr Color | FromRGB8 (u32 rrggbb, f32 a=1) |
| static constexpr Color | FromRGBA8 (u8 r, u8 g, u8 b, u8 a=255) |
| static constexpr Color | FromARGB8 (u32 argb) |
| static constexpr Color | Lerp (Color from, Color to, f32 t) |
Public Attributes | |
| f32 | r = 0 |
| f32 | g = 0 |
| f32 | b = 0 |
| f32 | a = 1 |
A color of four channels in the order red, green, blue, alpha. Each channel runs from 0 to 1.
|
inlinestaticconstexpr |
Returns a color from a packed 0xAARRGGBB value.
| argb | The packed value, alpha in the high byte. |
|
inlinestaticconstexpr |
Returns a color from a packed 0xRRGGBB value.
| rrggbb | The packed red, green and blue bytes, red in bits 16 to 23. |
|
inlinestaticconstexpr |
Returns a color from its channels.
| a | Alpha channel, opaque when omitted. |
|
inlinestaticconstexpr |
Returns a color from four bytes. Every byte is divided by 255.
| r | Red byte. |
| g | Green byte. |
| b | Blue byte. |
| a | Alpha byte, 255 is opaque. |
Returns the linear blend of two colors over every channel.
| from | The color at t equal to 0. |
| to | The color at t equal to 1. |
|
inlineconstexpr |
Returns this color with red, green and blue multiplied.
| factor | The multiplier. Alpha is unchanged. |
|
inlineconstexpr |
Returns the packed bytes with alpha in the high byte. The value is a << 24 | r << 16 | g << 8 | b with each channel clamped to 0..1 and rounded.
|
inlineconstexpr |
Returns the packed bytes with red in the low byte, the gpu::OverlayVertex order. The value is r | g << 8 | b << 16 | a << 24 with each channel clamped to 0..1 and rounded.
|
inlineconstexpr |
Returns this color with another alpha. The red, green and blue channels stay unchanged.
| f32 rex::ui::Color::a = 1 |
1 is opaque.