Mapper  0.9.0
API documentation
Public Member Functions | Public Attributes | List of all members
OpenOrienteering::MapColorRgb Struct Reference

The MapColorRgb class provides a datatype for storing and transferring opaque RGB colors. More...

#include <map_color.h>

Public Member Functions

 MapColorRgb () noexcept=default
 Constructs a black color. More...
 
 MapColorRgb (float r, float g, float b) noexcept
 Constructs a color with the given components. More...
 
 MapColorRgb (const MapColorRgb &other) noexcept=default
 Constructs a copy of the given RGB color. More...
 
 MapColorRgb (const QColor &other) noexcept
 Constructs a RGB color of the given QColor. More...
 
MapColorRgboperator= (const MapColorRgb &other) noexcept=default
 Assigns another color's value to this color. More...
 
 operator QColor () const
 Converts this color to a QColor. More...
 
bool isBlack () const
 Returns true if this color is black. More...
 
bool isWhite () const
 Returns true if this color is white. More...
 

Public Attributes

float r = 0
 The red component. More...
 
float g = 0
 The green component. More...
 
float b = 0
 The blue component. More...
 

Detailed Description

The MapColorRgb class provides a datatype for storing and transferring opaque RGB colors.

Components (r, g, b) are floats in the range [0.0; 1.0].

Constructor & Destructor Documentation

◆ MapColorRgb() [1/4]

OpenOrienteering::MapColorRgb::MapColorRgb ( )
defaultnoexcept

Constructs a black color.

◆ MapColorRgb() [2/4]

OpenOrienteering::MapColorRgb::MapColorRgb ( float  r,
float  g,
float  b 
)
inlinenoexcept

Constructs a color with the given components.

◆ MapColorRgb() [3/4]

OpenOrienteering::MapColorRgb::MapColorRgb ( const MapColorRgb other)
defaultnoexcept

Constructs a copy of the given RGB color.

◆ MapColorRgb() [4/4]

OpenOrienteering::MapColorRgb::MapColorRgb ( const QColor other)
inlinenoexcept

Constructs a RGB color of the given QColor.

Used for type conversions.

Member Function Documentation

◆ isBlack()

bool OpenOrienteering::MapColorRgb::isBlack ( ) const
inline

Returns true if this color is black.

◆ isWhite()

bool OpenOrienteering::MapColorRgb::isWhite ( ) const
inline

Returns true if this color is white.

◆ operator QColor()

OpenOrienteering::MapColorRgb::operator QColor ( ) const
inline

Converts this color to a QColor.

◆ operator=()

MapColorRgb& OpenOrienteering::MapColorRgb::operator= ( const MapColorRgb other)
defaultnoexcept

Assigns another color's value to this color.

Member Data Documentation

◆ b

float OpenOrienteering::MapColorRgb::b = 0

The blue component.

◆ g

float OpenOrienteering::MapColorRgb::g = 0

The green component.

◆ r

float OpenOrienteering::MapColorRgb::r = 0

The red component.


The documentation for this struct was generated from the following file: