ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Color Struct Reference

Struct describing a color. More...

#include <Acts/Visualization/ViewConfig.hpp>

Collaboration diagram for Acts::Color:
[legend]

Public Member Functions

 Color ()=default
 Color (Color &&)=default
 Move constructor.
 Color (const Color &)=default
 Copy constructor.
constexpr Color (double r, double g, double b)
 Constructor from raw double dgb values [0, 1].
constexpr Color (int r, int g, int b)
 Constructor from raw integer rgb values [0, 255].
constexpr Color (std::array< double, 3 > values)
 Constructor from array of double rgb values [0, 1].
constexpr Color (std::array< int, 3 > values)
 Constructor from array of integer rgb values [0, 255].
constexpr Color (std::string_view hex)
 Constructor from hex string.
Coloroperator= (Color &&)=default
 Move assignment operator.
Coloroperator= (const Color &)=default
 Copy assignment operator.
int & operator[] (unsigned int i)
 Operator to access the color components.
int operator[] (unsigned int i) const
 Operator to access the color components.

Public Attributes

std::array< int, 3 > rgb {}
 RGB color values (0-255) for red, green, blue components.

Detailed Description

Struct describing a color.

Internally, the color is represented using a triplet of integers between 0 and 255 corresponding to red green and blue.

Constructor & Destructor Documentation

◆ Color() [1/8]

Acts::Color::Color ( )
default

◆ Color() [2/8]

Acts::Color::Color ( const Color & )
default

Copy constructor.

◆ Color() [3/8]

Acts::Color::Color ( Color && )
default

Move constructor.

◆ Color() [4/8]

Acts::Color::Color ( int r,
int g,
int b )
constexpr

Constructor from raw integer rgb values [0, 255].

Parameters
rThe red component
gThe green component
bThe blue component

◆ Color() [5/8]

Acts::Color::Color ( std::array< int, 3 > values)
explicitconstexpr

Constructor from array of integer rgb values [0, 255].

Parameters
valuesThe rgb values

◆ Color() [6/8]

Acts::Color::Color ( std::array< double, 3 > values)
explicitconstexpr

Constructor from array of double rgb values [0, 1].

Parameters
valuesThe rgb values

◆ Color() [7/8]

Acts::Color::Color ( double r,
double g,
double b )
constexpr

Constructor from raw double dgb values [0, 1].

Parameters
rThe red component
gThe green component
bThe blue component

◆ Color() [8/8]

Acts::Color::Color ( std::string_view hex)
explicitconstexpr

Constructor from hex string.

The expected format is #RRGGBB

Parameters
hexThe hex string

Member Function Documentation

◆ operator=() [1/2]

Color & Acts::Color::operator= ( Color && )
default

Move assignment operator.

Returns
Reference to this Color after moving

◆ operator=() [2/2]

Color & Acts::Color::operator= ( const Color & )
default

Copy assignment operator.

Returns
Reference to this Color after copying

◆ operator[]() [1/2]

int & Acts::Color::operator[] ( unsigned int i)

Operator to access the color components.

Parameters
iThe index of the component
Returns
The color component

◆ operator[]() [2/2]

int Acts::Color::operator[] ( unsigned int i) const

Operator to access the color components.

Parameters
iThe index of the component
Returns
The color component

Member Data Documentation

◆ rgb

std::array<int, 3> Acts::Color::rgb {}

RGB color values (0-255) for red, green, blue components.