R-G-B-A color vector. More...
#include <helios_vector_types.h>
Public Member Functions | |
constexpr | RGBAcolor () |
Default constructor - initializes color to black. | |
constexpr | RGBAcolor (float red, float green, float blue, float alpha) |
Constructor given three floats denoting R-G-B components. | |
constexpr | RGBAcolor (const float C[4]) |
Constructor given an array of three floats denoting R-G-B-A components. | |
RGBAcolor (const std::vector< float > &C) | |
Constructor given a vector of three floats denoting R-G-B-A components. | |
void | scale (float scale_factor) |
Scale RGBAcolor by some factor. | |
constexpr RGBAcolor | operator+ (const RGBAcolor &c) const noexcept |
Add two RGBA colors together color-by-color. | |
constexpr RGBAcolor | operator- (const RGBAcolor &c) const noexcept |
Subtract two RGBA colors color-by-color. | |
constexpr bool | operator== (const helios::RGBAcolor &c) const noexcept |
check for equality of two RGBA colors | |
constexpr bool | operator!= (const helios::RGBAcolor &c) const noexcept |
check for inequality of two RGBA colors | |
Data Fields | |
float | r |
Red color component. | |
float | g |
Green color component. | |
float | b |
Blue color component. | |
float | a |
Alpha (transparency) component. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const helios::RGBAcolor &c) |
write RGBAcolor to output stream | |
R-G-B-A color vector.
Definition at line 1468 of file helios_vector_types.h.
|
inlineconstexpr |
Default constructor - initializes color to black.
Definition at line 1484 of file helios_vector_types.h.
|
inlineconstexpr |
Constructor given three floats denoting R-G-B components.
[in] | red | Red color component |
[in] | green | Green color component |
[in] | blue | Blue color component |
[in] | alpha | Alpha (transparency) component |
Definition at line 1495 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Constructor given an array of three floats denoting R-G-B-A components.
[in] | C | Array (4-elements) of R-G-B-A color components |
Definition at line 1503 of file helios_vector_types.h.
|
inlineexplicit |
Constructor given a vector of three floats denoting R-G-B-A components.
[in] | C | Vector (4-elements) of R-G-B-A color components |
Definition at line 1511 of file helios_vector_types.h.
|
constexprnoexcept |
check for inequality of two RGBA colors
Definition at line 1596 of file helios_vector_types.h.
Add two RGBA colors together color-by-color.
Definition at line 1600 of file helios_vector_types.h.
Subtract two RGBA colors color-by-color.
Definition at line 1604 of file helios_vector_types.h.
|
constexprnoexcept |
check for equality of two RGBA colors
Definition at line 1590 of file helios_vector_types.h.
|
inline |
Scale RGBAcolor by some factor.
[in] | scale_factor | Positive scaling factor |
Definition at line 1525 of file helios_vector_types.h.
|
friend |
write RGBAcolor to output stream
Definition at line 1536 of file helios_vector_types.h.
float helios::RGBAcolor::a |
Alpha (transparency) component.
Takes a value between 0 and 1.
Definition at line 1481 of file helios_vector_types.h.
float helios::RGBAcolor::b |
Blue color component.
Takes a value between 0 and 1.
Definition at line 1478 of file helios_vector_types.h.
float helios::RGBAcolor::g |
Green color component.
Takes a value between 0 and 1.
Definition at line 1475 of file helios_vector_types.h.
float helios::RGBAcolor::r |
Red color component.
Takes a value between 0 and 1.
Definition at line 1472 of file helios_vector_types.h.