|
Avara3D 0.2.0
C++ API reference
|
Represents a normalized RGBA color. More...
#include <a3d/Color.h>
Public Member Functions | |
| Color () | |
| Creates opaque white. More... | |
| Color (const math::vec3 &rgb) | |
| Creates an opaque color from floating-point RGB components. More... | |
| Color (float r, float g, float b) | |
| Creates an opaque color from floating-point RGB components. More... | |
| Color (const math::vec4 &rgba) | |
| Creates a color from floating-point RGBA components. More... | |
| Color (float r, float g, float b, float a) | |
| Creates a color from floating-point RGBA components. More... | |
| Color (const math::u8vec3 &irgb) | |
| Creates an opaque color from 8-bit RGB components. More... | |
| Color (const math::u8vec4 &irgba) | |
| Creates a color from 8-bit RGBA components. More... | |
| Color (float white) | |
Creates an opaque grayscale color with all RGB components set to white. More... | |
| Color (uint32_t color) | |
| Creates a color from a packed 0xRRGGBBAA value. More... | |
| Color (const std::string &hexString) | |
| Creates a color from hexadecimal RGB or RGBA text. More... | |
| float | r () const |
| Returns the floating-point red component. More... | |
| float | g () const |
| Returns the floating-point green component. More... | |
| float | b () const |
| Returns the floating-point blue component. More... | |
| float | a () const |
| Returns the floating-point alpha component. More... | |
| uint8_t | u8r () const |
| Returns the red component converted to 8-bit form. More... | |
| uint8_t | u8g () const |
| Returns the green component converted to 8-bit form. More... | |
| uint8_t | u8b () const |
| Returns the blue component converted to 8-bit form. More... | |
| uint8_t | u8a () const |
| Returns the alpha component converted to 8-bit form. More... | |
| math::vec3 | rgb () const |
| Returns the floating-point RGB components. More... | |
| math::vec4 | rgba () const |
| Returns the floating-point RGBA components. More... | |
| math::u8vec3 | u8rgb () const |
| Returns the RGB components converted to 8-bit form. More... | |
| math::u8vec4 | u8rgba () const |
| Returns the RGBA components converted to 8-bit form. More... | |
Static Public Member Functions | |
| static Color | Black () |
| Returns opaque black. More... | |
| static Color | DarkGray () |
| Returns opaque dark gray. More... | |
| static Color | Gray () |
| Returns opaque gray. More... | |
| static Color | LightGray () |
| Returns opaque light gray. More... | |
| static Color | White () |
| Returns opaque white. More... | |
| static Color | Maroon () |
| Returns opaque maroon. More... | |
| static Color | Red () |
| Returns opaque red. More... | |
| static Color | Orange () |
| Returns opaque orange. More... | |
| static Color | Yellow () |
| Returns opaque yellow. More... | |
| static Color | Olive () |
| Returns opaque olive. More... | |
| static Color | Lime () |
| Returns opaque lime. More... | |
| static Color | Green () |
| Returns opaque green. More... | |
| static Color | Cyan () |
| Returns opaque cyan. More... | |
| static Color | Blue () |
| Returns opaque blue. More... | |
| static Color | Navy () |
| Returns opaque navy. More... | |
| static Color | Teal () |
| Returns opaque teal. More... | |
| static Color | Magenta () |
| Returns opaque magenta. More... | |
| static Color | Purple () |
| Returns opaque purple. More... | |
| static Color | Brown () |
| Returns opaque brown. More... | |
| static Color | Random () |
| Returns an opaque color with independently randomized 8-bit RGB channels. More... | |
Represents a normalized RGBA color.
Components are stored as floating-point values in the range [0, 1]. Floating-point inputs outside this range are clamped. Eight-bit accessors scale the stored components to [0, 255] and round to the nearest integer.
| a3d::Color::Color | ( | ) |
Creates opaque white.
|
explicit |
Creates an opaque color from floating-point RGB components.
| a3d::Color::Color | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
Creates an opaque color from floating-point RGB components.
|
explicit |
Creates a color from floating-point RGBA components.
| a3d::Color::Color | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
Creates a color from floating-point RGBA components.
|
explicit |
Creates an opaque color from 8-bit RGB components.
|
explicit |
Creates a color from 8-bit RGBA components.
|
explicit |
Creates an opaque grayscale color with all RGB components set to white.
|
explicit |
Creates a color from a packed 0xRRGGBBAA value.
|
explicit |
Creates a color from hexadecimal RGB or RGBA text.
Supported forms are RRGGBB, #RRGGBB, RRGGBBAA, and #RRGGBBAA.
| float a3d::Color::a | ( | ) | const |
Returns the floating-point alpha component.
| float a3d::Color::b | ( | ) | const |
Returns the floating-point blue component.
|
static |
Returns opaque black.
|
static |
Returns opaque blue.
|
static |
Returns opaque brown.
|
static |
Returns opaque cyan.
|
static |
Returns opaque dark gray.
| float a3d::Color::g | ( | ) | const |
Returns the floating-point green component.
|
static |
Returns opaque gray.
|
static |
Returns opaque green.
|
static |
Returns opaque light gray.
|
static |
Returns opaque lime.
|
static |
Returns opaque magenta.
|
static |
Returns opaque maroon.
|
static |
Returns opaque navy.
|
static |
Returns opaque olive.
|
static |
Returns opaque orange.
|
static |
Returns opaque purple.
| float a3d::Color::r | ( | ) | const |
Returns the floating-point red component.
|
static |
Returns an opaque color with independently randomized 8-bit RGB channels.
|
static |
Returns opaque red.
| math::vec3 a3d::Color::rgb | ( | ) | const |
Returns the floating-point RGB components.
| math::vec4 a3d::Color::rgba | ( | ) | const |
Returns the floating-point RGBA components.
|
static |
Returns opaque teal.
| uint8_t a3d::Color::u8a | ( | ) | const |
Returns the alpha component converted to 8-bit form.
| uint8_t a3d::Color::u8b | ( | ) | const |
Returns the blue component converted to 8-bit form.
| uint8_t a3d::Color::u8g | ( | ) | const |
Returns the green component converted to 8-bit form.
| uint8_t a3d::Color::u8r | ( | ) | const |
Returns the red component converted to 8-bit form.
| math::u8vec3 a3d::Color::u8rgb | ( | ) | const |
Returns the RGB components converted to 8-bit form.
| math::u8vec4 a3d::Color::u8rgba | ( | ) | const |
Returns the RGBA components converted to 8-bit form.
|
static |
Returns opaque white.
|
static |
Returns opaque yellow.