#include <vtkQtChartColors.h>
Definition at line 36 of file 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. | |
static QColor | interpolateHsv (const QColor &color1, const QColor &color2, float fraction) |
Gets a new color between the given colors in hsv space. | |
static QColor | interpolateRgb (const QColor &color1, const QColor &color2, float fraction) |
Gets a new color between the given colors in rgb space. |
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 | ( | ) |
vtkQtChartColors& vtkQtChartColors::operator= | ( | const vtkQtChartColors & | other | ) |
Makes a copy of another chart colors instance.
other | The chart colors to copy. |
ColorScheme vtkQtChartColors::getColorScheme | ( | ) | const [inline] |
Gets the current color scheme.
Definition at line 73 of file vtkQtChartColors.h.
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. |
int vtkQtChartColors::getNumberOfColors | ( | ) | const |
Gets the number of colors in the color list.
QColor vtkQtChartColors::getColor | ( | int | index | ) | const |
Gets the color for the given index.
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::clearColors | ( | ) |
Clears the list of colors.
void vtkQtChartColors::addColor | ( | const QColor & | color | ) |
Adds a color to the list of colors.
color | The new color to add. |
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. |
void vtkQtChartColors::removeColor | ( | int | index | ) |
Removes the color for the given index.
index | Which color to remove from the list. |
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. |
static QColor vtkQtChartColors::interpolateHsv | ( | const QColor & | color1, | |
const QColor & | color2, | |||
float | fraction | |||
) | [static] |
Gets a new color between the given colors in hsv space.
The interpolation does not wrap around in the hue component.
color1 | The first color. | |
color2 | The last color. | |
fraction | The fraction (0.0 to 1.0) of the distance from color1 to color2 . |
static QColor vtkQtChartColors::interpolateRgb | ( | const QColor & | color1, | |
const QColor & | color2, | |||
float | fraction | |||
) | [static] |
Gets a new color between the given colors in rgb space.
color1 | The first color. | |
color2 | The last color. | |
fraction | The fraction (0.0 to 1.0) of the distance from color1 to color2 . |