The vtkQtChartColors class stores a list of colors. More...
#include <vtkQtChartColors.h>
Public Types | |
enum | ColorScheme { Spectrum = 0, Warm, Cool, Blues, WildFlower, Citrus, Custom } |
Public Member Functions | |
vtkQtChartColors (ColorScheme scheme=Spectrum) | |
Creates a chart colors instance. | |
vtkQtChartColors (const vtkQtChartColors &other) | |
Makes a copy of another chart colors instance. | |
~vtkQtChartColors () | |
vtkQtChartColors & | operator= (const vtkQtChartColors &other) |
Makes a copy of another chart colors instance. | |
ColorScheme | getColorScheme () const |
Gets the current color scheme. | |
void | setColorScheme (ColorScheme scheme) |
Sets the color scheme. | |
int | getNumberOfColors () const |
Gets the number of colors in the color list. | |
QColor | getColor (int index) const |
Gets the color for the given index. | |
void | setColor (int index, const QColor &color) |
Sets the color for the given index. | |
void | clearColors () |
Clears the list of colors. | |
void | addColor (const QColor &color) |
Adds a color to the list of colors. | |
void | insertColor (int index, const QColor &color) |
Inserts a new color into the list of colors. | |
void | removeColor (int index) |
Removes the color for the given index. | |
Static Public Member Functions | |
static QColor | lighter (const QColor color, float factor=0.7) |
Creates a lighter color from the given color. |
The vtkQtChartColors class stores a list of colors.
Definition at line 36 of file vtkQtChartColors.h.
Definition at line 39 of file vtkQtChartColors.h.
vtkQtChartColors::vtkQtChartColors | ( | ColorScheme | scheme = Spectrum ) |
Creates a chart colors instance.
scheme | The initial color scheme. |
vtkQtChartColors::vtkQtChartColors | ( | const vtkQtChartColors & | other ) |
Makes a copy of another chart colors instance.
other | The chart colors to copy. |
vtkQtChartColors::~vtkQtChartColors | ( | ) |
void vtkQtChartColors::addColor | ( | const QColor & | color ) |
Adds a color to the list of colors.
color | The new color to add. |
void vtkQtChartColors::clearColors | ( | ) |
Clears the list of colors.
QColor vtkQtChartColors::getColor | ( | int | index ) | const |
Gets the color for the given index.
ColorScheme vtkQtChartColors::getColorScheme | ( | ) | const [inline] |
Gets the current color scheme.
Definition at line 73 of file vtkQtChartColors.h.
{return this->Scheme;}
int vtkQtChartColors::getNumberOfColors | ( | ) | const |
Gets the number of colors in the color list.
void vtkQtChartColors::insertColor | ( | int | index, |
const QColor & | color | ||
) |
Inserts a new color into the list of colors.
index | Where to insert the new color. |
color | The new color to insert. |
static QColor vtkQtChartColors::lighter | ( | const QColor | color, |
float | factor = 0.7 |
||
) | [static] |
Creates a lighter color from the given color.
The QColor::light
method does not work for black. This function uses a 3D equation in rgb space to compute the lighter color, which works for all colors including black. the factor determines how light the new color will be. The factor is used to find the point between the current color and white.
color | The starting color. |
factor | A percentage (0.0 to 1.0) of the distance from the given color to white. |
vtkQtChartColors& vtkQtChartColors::operator= | ( | const vtkQtChartColors & | other ) |
Makes a copy of another chart colors instance.
other | The chart colors to copy. |
void vtkQtChartColors::removeColor | ( | int | index ) |
Removes the color for the given index.
index | Which color to remove from the list. |
void vtkQtChartColors::setColor | ( | int | index, |
const QColor & | color | ||
) |
Sets the color for the given index.
This method does nothing if the index is out of range.
index | Which color to modify. |
color | The new color. |
void vtkQtChartColors::setColorScheme | ( | ColorScheme | scheme ) |
Sets the color scheme.
The color scheme will automatically be changed to Custom
if the color list is modified.
scheme | The new color scheme. |