|
mupp 1.1.0
|
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) | |
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:
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.
| 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.
|
inlinevirtual |
Destructor.
Definition at line 94 of file PmuppAdmin.h.
|
inline |
Gets the color name.
Definition at line 100 of file PmuppAdmin.h.
|
inline |
Gets the RGB values of the color.
| r | output parameter: red component (0-255) |
| g | output parameter: green component (0-255) |
| b | output parameter: blue component (0-255) |
Definition at line 108 of file PmuppAdmin.h.
|
inline |
Sets the color name.
| name | the name identifier to assign to this color |
Definition at line 114 of file PmuppAdmin.h.
| 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.
| r | red component (0-255) |
| g | green component (0-255) |
| b | blue 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.
| r | red component (0-255) |
| g | green component (0-255) |
| b | blue component (0-255) |
Definition at line 100 of file PmuppAdmin.cpp.
|
private |
blue component (0-255)
Definition at line 128 of file PmuppAdmin.h.
|
private |
green component (0-255)
Definition at line 127 of file PmuppAdmin.h.
|
private |
optional name identifier for the color
Definition at line 125 of file PmuppAdmin.h.
|
private |
red component (0-255)
Definition at line 126 of file PmuppAdmin.h.