mupp 1.1.0
Loading...
Searching...
No Matches
PmuppColor Class Reference

Represents an RGB color for plotting. More...

#include <PmuppAdmin.h>

Public Member Functions

 PmuppColor ()
 Default constructor. Initializes color with undefined values.
 
virtual ~PmuppColor ()
 Destructor.
 
QString getName ()
 Gets the color name.
 
void getRGB (int &r, int &g, int &b)
 Gets the RGB values of the color.
 
void setName (const QString name)
 Sets the color name.
 
void setRGB (const int r, const int g, const int b)
 Sets the RGB values with validation.
 

Private Attributes

QString fName
 optional name identifier for the color
 
int fRed
 red component (0-255)
 
int fGreen
 green component (0-255)
 
int fBlue
 blue component (0-255)
 

Detailed Description

Represents an RGB color for plotting.

The PmuppColor class encapsulates a named color with RGB components. Colors are read from the XML startup configuration file and used for plotting data points, lines, and other graphical elements in mupp.

Each color has:

  • A name identifier (optional)
  • RGB values in the range 0-255

These colors allow users to customize the appearance of plots and ensure consistency across different data collections.

Definition at line 84 of file PmuppAdmin.h.

Constructor & Destructor Documentation

◆ PmuppColor()

PmuppColor::PmuppColor ( )

Default constructor. Initializes color with undefined values.

Default constructor for PmuppColor.

Initializes a color with an "UnDef" name and invalid RGB values (-1). Invalid values indicate the color has not been properly initialized.

Definition at line 80 of file PmuppAdmin.cpp.

◆ ~PmuppColor()

virtual PmuppColor::~PmuppColor ( )
inlinevirtual

Destructor.

Definition at line 94 of file PmuppAdmin.h.

Member Function Documentation

◆ getName()

QString PmuppColor::getName ( )
inline

Gets the color name.

Returns
the name identifier of the color

Definition at line 100 of file PmuppAdmin.h.

◆ getRGB()

void PmuppColor::getRGB ( int & r,
int & g,
int & b )
inline

Gets the RGB values of the color.

Parameters
routput parameter: red component (0-255)
goutput parameter: green component (0-255)
boutput parameter: blue component (0-255)

Definition at line 108 of file PmuppAdmin.h.

◆ setName()

void PmuppColor::setName ( const QString name)
inline

Sets the color name.

Parameters
namethe name identifier to assign to this color

Definition at line 114 of file PmuppAdmin.h.

◆ setRGB()

void PmuppColor::setRGB ( const int r,
const int g,
const int b )

Sets the RGB values with validation.

Sets the RGB color values with validation.

Parameters
rred component (0-255)
ggreen component (0-255)
bblue component (0-255)

Sets the red, green, and blue components of the color. Each component is validated to be in the range [0, 255]. Values outside this range are ignored and the corresponding component remains unchanged.

Parameters
rred component (0-255)
ggreen component (0-255)
bblue component (0-255)

Definition at line 100 of file PmuppAdmin.cpp.

Member Data Documentation

◆ fBlue

int PmuppColor::fBlue
private

blue component (0-255)

Definition at line 128 of file PmuppAdmin.h.

◆ fGreen

int PmuppColor::fGreen
private

green component (0-255)

Definition at line 127 of file PmuppAdmin.h.

◆ fName

QString PmuppColor::fName
private

optional name identifier for the color

Definition at line 125 of file PmuppAdmin.h.

◆ fRed

int PmuppColor::fRed
private

red component (0-255)

Definition at line 126 of file PmuppAdmin.h.


The documentation for this class was generated from the following files: