bn::color class
#include <bn_color.h>

Defines a color in the GBA format (15 bits BGR).

Constructors, destructors, conversion operators

color() defaulted constexpr
Default constructor.
color(int data) explicit constexpr
Constructor.
color(int red, int green, int blue) constexpr
Constructor.

Public functions

auto data() const -> int constexpr
Returns the representation of this color in GBA format.
void set_data(int data) constexpr
Sets the representation of this color in GBA format.
void set_components(int red, int green, int blue) constexpr
Sets all the components of this color.
auto red() const -> int constexpr
Returns the red component.
void set_red(int red) constexpr
Sets the red component.
auto green() const -> int constexpr
Returns the green component.
void set_green(int green) constexpr
Sets the green component.
auto blue() const -> int constexpr
Returns the blue component.
void set_blue(int blue) constexpr
Sets the blue component.

Friends

auto operator==(color a, color b) -> bool defaulted constexpr
Default equal operator.

Function documentation

bn::color::color(int data) explicit constexpr

Constructor.

Parameters
data Color value in GBA format.

bn::color::color(int red, int green, int blue) constexpr

Constructor.

Parameters
red Red component, in the range [0..31].
green Green component, in the range [0..31].
blue Blue component, in the range [0..31].

void bn::color::set_components(int red, int green, int blue) constexpr

Sets all the components of this color.

Parameters
red Red component, in the range [0..31].
green Green component, in the range [0..31].
blue Blue component, in the range [0..31].

void bn::color::set_red(int red) constexpr

Sets the red component.

Parameters
red Red component, in the range [0..31].

void bn::color::set_green(int green) constexpr

Sets the green component.

Parameters
green Green component, in the range [0..31].

void bn::color::set_blue(int blue) constexpr

Sets the blue component.

Parameters
blue Blue component, in the range [0..31].